{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "b6a6cacced554478abed754b32c8bdaf": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_2f790bb14abf4135a5e8d5b667b7a053",
              "IPY_MODEL_6d48947b0a184b4c8db624247e3eae13",
              "IPY_MODEL_ff21ede6f3d440668e4a4b2f4c02a6ef"
            ],
            "layout": "IPY_MODEL_b40f8c8354dd44aeb48987055f1c21ef"
          }
        },
        "2f790bb14abf4135a5e8d5b667b7a053": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d2083ab1595b4795a15233203ffe7155",
            "placeholder": "​",
            "style": "IPY_MODEL_0b7de314ab6540b0a584ab601d008247",
            "value": "Validation DataLoader 0: 100%"
          }
        },
        "6d48947b0a184b4c8db624247e3eae13": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_87e6fc4c6a16477490ad94c47be89e2f",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_f27d5212e2744980ab4c0f0d5b187dee",
            "value": 196
          }
        },
        "ff21ede6f3d440668e4a4b2f4c02a6ef": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_3c00f52a6618438dbf7930e72aa56070",
            "placeholder": "​",
            "style": "IPY_MODEL_e9fa822100b04fd9ae423f572ac0a3b6",
            "value": " 196/196 [00:00&lt;00:00, 276.81it/s]"
          }
        },
        "b40f8c8354dd44aeb48987055f1c21ef": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "d2083ab1595b4795a15233203ffe7155": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0b7de314ab6540b0a584ab601d008247": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "87e6fc4c6a16477490ad94c47be89e2f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f27d5212e2744980ab4c0f0d5b187dee": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "3c00f52a6618438dbf7930e72aa56070": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e9fa822100b04fd9ae423f572ac0a3b6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "5c92afb6951f4194824019c8042e07b0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_6add077d6545439dad0f9db1585b2504",
              "IPY_MODEL_01cf010f15c44a408bb5ea1a317ea320",
              "IPY_MODEL_5df6144974934233a219199c24229981"
            ],
            "layout": "IPY_MODEL_9ed6f7ba59a248db932b18c9cfe2b07e"
          }
        },
        "6add077d6545439dad0f9db1585b2504": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_5dbefe5091e7463e80fab6ea8222ea77",
            "placeholder": "​",
            "style": "IPY_MODEL_9f6ee17ed6184906bd9c77a133c0ef3e",
            "value": "Epoch 4: 100%"
          }
        },
        "01cf010f15c44a408bb5ea1a317ea320": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_04923785f16a42d29b0ad90829ff7ebc",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_416731f1221848ceafbbb7c246c17184",
            "value": 196
          }
        },
        "5df6144974934233a219199c24229981": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_0a9020973d994f69948b5a0dcde0beb1",
            "placeholder": "​",
            "style": "IPY_MODEL_27d4dcce297d4fbca49928112fe9ae48",
            "value": " 196/196 [00:01&lt;00:00, 183.87it/s, v_num=13]"
          }
        },
        "9ed6f7ba59a248db932b18c9cfe2b07e": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "5dbefe5091e7463e80fab6ea8222ea77": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9f6ee17ed6184906bd9c77a133c0ef3e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "04923785f16a42d29b0ad90829ff7ebc": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "416731f1221848ceafbbb7c246c17184": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "0a9020973d994f69948b5a0dcde0beb1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "27d4dcce297d4fbca49928112fe9ae48": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "27929af80e9743008c0e2a685d91a3a8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_0ea49ab37ab84affaff360242b68c279",
              "IPY_MODEL_4691719986c446b5a146b1ee5279333f",
              "IPY_MODEL_43980dd9c3fb4c8ab4a51aa9fa4590cd"
            ],
            "layout": "IPY_MODEL_5e66f600314d426699d7b9e7ae6def7d"
          }
        },
        "0ea49ab37ab84affaff360242b68c279": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_a8a77ca4399f438999c24b85c8e8b8c9",
            "placeholder": "​",
            "style": "IPY_MODEL_b1b8d580a7ca45de9d96f5b43afa2a5e",
            "value": "Validation DataLoader 0: 100%"
          }
        },
        "4691719986c446b5a146b1ee5279333f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_ab70d6bd9acc4edc8210b8ab890cc984",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_dcfac8234b2849c38da25a21efc16aff",
            "value": 196
          }
        },
        "43980dd9c3fb4c8ab4a51aa9fa4590cd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_3f480166102a4d879b7a43b91715bb08",
            "placeholder": "​",
            "style": "IPY_MODEL_605bc5f7472b4a46809f2a9863588776",
            "value": " 196/196 [00:00&lt;00:00, 299.08it/s]"
          }
        },
        "5e66f600314d426699d7b9e7ae6def7d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "a8a77ca4399f438999c24b85c8e8b8c9": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b1b8d580a7ca45de9d96f5b43afa2a5e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "ab70d6bd9acc4edc8210b8ab890cc984": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "dcfac8234b2849c38da25a21efc16aff": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "3f480166102a4d879b7a43b91715bb08": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "605bc5f7472b4a46809f2a9863588776": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "afa89fcbd202483da2639103829f1a17": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_07806541decf40c6a563acb1fab92131",
              "IPY_MODEL_f0294e73fc2b4378b72e4d9927e99ac3",
              "IPY_MODEL_45570dc2aada4285bc9a6f9bd577fcfd"
            ],
            "layout": "IPY_MODEL_3aaadacc8a1c43d6a5f634669e3fe8fb"
          }
        },
        "07806541decf40c6a563acb1fab92131": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_545a7a7b169749638f11b041743087d1",
            "placeholder": "​",
            "style": "IPY_MODEL_b883c76ddbf74edeb10c3fc442271eb9",
            "value": "Validation DataLoader 0: 100%"
          }
        },
        "f0294e73fc2b4378b72e4d9927e99ac3": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d5e734b74b6b4420b57048c469f125c0",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_a4b16a6948b645538d45d1f6a0a42cf4",
            "value": 196
          }
        },
        "45570dc2aada4285bc9a6f9bd577fcfd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_27ed3a78e167420dbfec61bcf6ec5de5",
            "placeholder": "​",
            "style": "IPY_MODEL_e26aeae539284c9e99af2048c5e57f63",
            "value": " 196/196 [00:01&lt;00:00, 173.97it/s]"
          }
        },
        "3aaadacc8a1c43d6a5f634669e3fe8fb": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "545a7a7b169749638f11b041743087d1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b883c76ddbf74edeb10c3fc442271eb9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d5e734b74b6b4420b57048c469f125c0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a4b16a6948b645538d45d1f6a0a42cf4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "27ed3a78e167420dbfec61bcf6ec5de5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e26aeae539284c9e99af2048c5e57f63": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "e9af983a251a4c0ab76ef2cb4a8c0e53": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_6448add48dd04f24b7556ae9e85c4df4",
              "IPY_MODEL_0dd7838d5d974dd59b5128d975723dc0",
              "IPY_MODEL_ed9271e198b54c57a2fe837ada880268"
            ],
            "layout": "IPY_MODEL_1b7e150e0e464c33aa8f64fcf22dfb6a"
          }
        },
        "6448add48dd04f24b7556ae9e85c4df4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2d35b60ea18e44209f905b92c35abcbe",
            "placeholder": "​",
            "style": "IPY_MODEL_55eab8b693f944f8a9e013e9f06a6a1a",
            "value": "Epoch 24: 100%"
          }
        },
        "0dd7838d5d974dd59b5128d975723dc0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_762fcf3b646b4dd7b27bb35937a048d0",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_858ecde6e4704dbfa37adb533f65d22f",
            "value": 196
          }
        },
        "ed9271e198b54c57a2fe837ada880268": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e6220dcbec4b43e1ac085d5f20991e0a",
            "placeholder": "​",
            "style": "IPY_MODEL_9bfdaf659d0340aeb0e000f8536d29fd",
            "value": " 196/196 [00:02&lt;00:00, 83.19it/s, v_num=11, train_loss=0.403]"
          }
        },
        "1b7e150e0e464c33aa8f64fcf22dfb6a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "2d35b60ea18e44209f905b92c35abcbe": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "55eab8b693f944f8a9e013e9f06a6a1a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "762fcf3b646b4dd7b27bb35937a048d0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "858ecde6e4704dbfa37adb533f65d22f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "e6220dcbec4b43e1ac085d5f20991e0a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "9bfdaf659d0340aeb0e000f8536d29fd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "c84c2227538e4f2686200d593cf20be4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_243b9ac67e5140a795dbb15bc15e0979",
              "IPY_MODEL_17b47b6ee6be484285138c7cd0a21cff",
              "IPY_MODEL_221586b4dce845eb86102300aacaa6d4"
            ],
            "layout": "IPY_MODEL_a24115071b374598899e6719ca798b2b"
          }
        },
        "243b9ac67e5140a795dbb15bc15e0979": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_18d211c343ee4d919ee14baa958ab555",
            "placeholder": "​",
            "style": "IPY_MODEL_e1b8b7799bf849f39b4a6be2c5d09305",
            "value": "Validation DataLoader 0: 100%"
          }
        },
        "17b47b6ee6be484285138c7cd0a21cff": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e652cb209d1e426ca2b9bc6e53298b34",
            "max": 196,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_10bf616ae3de43cda467746544f6e48a",
            "value": 196
          }
        },
        "221586b4dce845eb86102300aacaa6d4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_0a2d58c9f5fe44d89ba3ffea45fb8a56",
            "placeholder": "​",
            "style": "IPY_MODEL_d13e81bfd2764ceca2f3548fdf3308b8",
            "value": " 196/196 [00:01&lt;00:00, 132.92it/s]"
          }
        },
        "a24115071b374598899e6719ca798b2b": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": "inline-flex",
            "flex": null,
            "flex_flow": "row wrap",
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "100%"
          }
        },
        "18d211c343ee4d919ee14baa958ab555": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "e1b8b7799bf849f39b4a6be2c5d09305": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "e652cb209d1e426ca2b9bc6e53298b34": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": "2",
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "10bf616ae3de43cda467746544f6e48a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "0a2d58c9f5fe44d89ba3ffea45fb8a56": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "d13e81bfd2764ceca2f3548fdf3308b8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        }
      }
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "source": [
        "!pip install 'portalocker>=2.0.0'\n",
        "!pip install 'pytorch-lightning'"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "A0ZNSDH9tZ6Q",
        "outputId": "82c8696f-38cd-4df6-9c0a-acf6db50def0"
      },
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Collecting portalocker>=2.0.0\n",
            "  Downloading portalocker-2.8.2-py3-none-any.whl (17 kB)\n",
            "Installing collected packages: portalocker\n",
            "Successfully installed portalocker-2.8.2\n",
            "Collecting pytorch-lightning\n",
            "  Downloading pytorch_lightning-2.1.2-py3-none-any.whl (776 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m776.9/776.9 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: numpy>=1.17.2 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (1.23.5)\n",
            "Requirement already satisfied: torch>=1.12.0 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (2.1.0+cu118)\n",
            "Requirement already satisfied: tqdm>=4.57.0 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (4.66.1)\n",
            "Requirement already satisfied: PyYAML>=5.4 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (6.0.1)\n",
            "Requirement already satisfied: fsspec[http]>2021.06.0 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (2023.6.0)\n",
            "Collecting torchmetrics>=0.7.0 (from pytorch-lightning)\n",
            "  Downloading torchmetrics-1.2.0-py3-none-any.whl (805 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m805.2/805.2 kB\u001b[0m \u001b[31m13.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (23.2)\n",
            "Requirement already satisfied: typing-extensions>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from pytorch-lightning) (4.5.0)\n",
            "Collecting lightning-utilities>=0.8.0 (from pytorch-lightning)\n",
            "  Downloading lightning_utilities-0.10.0-py3-none-any.whl (24 kB)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from fsspec[http]>2021.06.0->pytorch-lightning) (2.31.0)\n",
            "Requirement already satisfied: aiohttp!=4.0.0a0,!=4.0.0a1 in /usr/local/lib/python3.10/dist-packages (from fsspec[http]>2021.06.0->pytorch-lightning) (3.8.6)\n",
            "Requirement already satisfied: setuptools in /usr/local/lib/python3.10/dist-packages (from lightning-utilities>=0.8.0->pytorch-lightning) (67.7.2)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=1.12.0->pytorch-lightning) (3.13.1)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.12.0->pytorch-lightning) (1.12)\n",
            "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.12.0->pytorch-lightning) (3.2.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.12.0->pytorch-lightning) (3.1.2)\n",
            "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.12.0->pytorch-lightning) (2.1.0)\n",
            "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (23.1.0)\n",
            "Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (3.3.2)\n",
            "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (6.0.4)\n",
            "Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (4.0.3)\n",
            "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (1.9.2)\n",
            "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (1.4.0)\n",
            "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp!=4.0.0a0,!=4.0.0a1->fsspec[http]>2021.06.0->pytorch-lightning) (1.3.1)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.12.0->pytorch-lightning) (2.1.3)\n",
            "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->fsspec[http]>2021.06.0->pytorch-lightning) (3.4)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->fsspec[http]>2021.06.0->pytorch-lightning) (2.0.7)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->fsspec[http]>2021.06.0->pytorch-lightning) (2023.7.22)\n",
            "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.12.0->pytorch-lightning) (1.3.0)\n",
            "Installing collected packages: lightning-utilities, torchmetrics, pytorch-lightning\n",
            "Successfully installed lightning-utilities-0.10.0 pytorch-lightning-2.1.2 torchmetrics-1.2.0\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 88,
      "metadata": {
        "id": "kBFrbS7btMn4"
      },
      "outputs": [],
      "source": [
        "import torch\n",
        "from tqdm import tqdm\n",
        "import torchtext.datasets as datasets\n",
        "from collections import Counter"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train = datasets.IMDB('./', split=\"train\")\n",
        "test = datasets.IMDB('./', split=\"test\")"
      ],
      "metadata": {
        "id": "KOMLq_V1tRYo"
      },
      "execution_count": 89,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "train_data = []\n",
        "for label, text in train:\n",
        "  train_data.append((label, text))\n",
        "print(\"Label Counts for Train Data: \", Counter([_[0] for _ in train_data]))\n",
        "\n",
        "test_data = []\n",
        "for label, text in test:\n",
        "  test_data.append((label, text))\n",
        "print(\"Label Counts for Train Data: \", Counter([_[0] for _ in test_data]))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "2BB9iI9ltWak",
        "outputId": "fb7579c6-536b-4971-fc70-8ff3587a4096"
      },
      "execution_count": 90,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Label Counts for Train Data:  Counter({1: 12500, 2: 12500})\n",
            "Label Counts for Train Data:  Counter({1: 12500, 2: 12500})\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_data[0]"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "-BnHFATVcy-U",
        "outputId": "37abdaf4-587d-4ab2-cafb-70397ec6da7f"
      },
      "execution_count": 91,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(1,\n",
              " 'I rented I AM CURIOUS-YELLOW from my video store because of all the controversy that surrounded it when it was first released in 1967. I also heard that at first it was seized by U.S. customs if it ever tried to enter this country, therefore being a fan of films considered \"controversial\" I really had to see this for myself.<br /><br />The plot is centered around a young Swedish drama student named Lena who wants to learn everything she can about life. In particular she wants to focus her attentions to making some sort of documentary on what the average Swede thought about certain political issues such as the Vietnam War and race issues in the United States. In between asking politicians and ordinary denizens of Stockholm about their opinions on politics, she has sex with her drama teacher, classmates, and married men.<br /><br />What kills me about I AM CURIOUS-YELLOW is that 40 years ago, this was considered pornographic. Really, the sex and nudity scenes are few and far between, even then it\\'s not shot like some cheaply made porno. While my countrymen mind find it shocking, in reality sex and nudity are a major staple in Swedish cinema. Even Ingmar Bergman, arguably their answer to good old boy John Ford, had sex scenes in his films.<br /><br />I do commend the filmmakers for the fact that any sex shown in the film is shown for artistic purposes rather than just to shock people and make money to be shown in pornographic theaters in America. I AM CURIOUS-YELLOW is a good film for anyone wanting to study the meat and potatoes (no pun intended) of Swedish cinema. But really, this film doesn\\'t have much of a plot.')"
            ]
          },
          "metadata": {},
          "execution_count": 91
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Bag-of-Words Features Baseline Model\n",
        "\n",
        "#### Let's preprocess the data first\n"
      ],
      "metadata": {
        "id": "LIliDuuoz7gT"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# We want to remove all html tags\n",
        "# Remove punctuation\n",
        "# remove all the stopwords\n",
        "####\n",
        "# apply stemming on the words\n",
        "# OR\n",
        "# apply lemmatization on the words\n",
        "\n",
        "import re\n",
        "import nltk\n",
        "import string\n",
        "from nltk.corpus import stopwords\n",
        "from nltk.stem.porter import PorterStemmer\n",
        "from nltk.stem import WordNetLemmatizer\n",
        "\n",
        "nltk.download('stopwords')\n",
        "nltk.download('wordnet')\n",
        "porter_stemmer = PorterStemmer()\n",
        "lemmatizer = WordNetLemmatizer()\n",
        "\n",
        "def remove_punctuation(text):\n",
        "    new_text = []\n",
        "    for i in text:\n",
        "      if i not in string.punctuation and i not in string.digits:\n",
        "        new_text.append(i)\n",
        "      else:\n",
        "        new_text.append(\" \")\n",
        "    return \"\".join(new_text)\n",
        "\n",
        "def remove_html_tags(text):\n",
        "    clean = re.compile('<.*?>')\n",
        "    return re.sub(clean, '', text).lower().strip()\n",
        "\n",
        "def remove_stopwords(text):\n",
        "    all_stop_words = set(stopwords.words('english'))\n",
        "    new_text = []\n",
        "    for word in re.split(\"\\W+\", text):\n",
        "      if word not in all_stop_words:\n",
        "        new_text.append(word)\n",
        "    return new_text\n",
        "\n",
        "def word_stemming(words):\n",
        "    return [porter_stemmer.stem(word) for word in words]\n",
        "\n",
        "def word_lemmatizer(words):\n",
        "    return [lemmatizer.lemmatize(word) for word in words]\n",
        "\n",
        "def convert_to_paragraph(words):\n",
        "    return \" \".join(words)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "VvOQOdsytoW_",
        "outputId": "168238e7-22d4-46cb-b965-5c6dcc998fe0"
      },
      "execution_count": 92,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "[nltk_data] Downloading package stopwords to /root/nltk_data...\n",
            "[nltk_data]   Package stopwords is already up-to-date!\n",
            "[nltk_data] Downloading package wordnet to /root/nltk_data...\n",
            "[nltk_data]   Package wordnet is already up-to-date!\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "convert_to_paragraph(\n",
        "    word_lemmatizer(\n",
        "            remove_stopwords(\n",
        "                remove_punctuation(\n",
        "                    remove_html_tags(\n",
        "                        train_data[0][1])))))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 196
        },
        "id": "9c7rP_t_3lZX",
        "outputId": "0bd7db92-acde-4f71-f397-b80c32f1f3fa"
      },
      "execution_count": 93,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "'rented curious yellow video store controversy surrounded first released also heard first seized u custom ever tried enter country therefore fan film considered controversial really see plot centered around young swedish drama student named lena want learn everything life particular want focus attention making sort documentary average swede thought certain political issue vietnam war race issue united state asking politician ordinary denizen stockholm opinion politics sex drama teacher classmate married men kill curious yellow year ago considered pornographic really sex nudity scene far even shot like cheaply made porno countryman mind find shocking reality sex nudity major staple swedish cinema even ingmar bergman arguably answer good old boy john ford sex scene film commend filmmaker fact sex shown film shown artistic purpose rather shock people make money shown pornographic theater america curious yellow good film anyone wanting study meat potato pun intended swedish cinema really film much plot '"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "string"
            }
          },
          "metadata": {},
          "execution_count": 93
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_data[0][1]"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 196
        },
        "id": "bnW8W6BX3pzV",
        "outputId": "28b75781-2cf9-4e7d-9fbf-0b0c6877cb6d"
      },
      "execution_count": 94,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "'I rented I AM CURIOUS-YELLOW from my video store because of all the controversy that surrounded it when it was first released in 1967. I also heard that at first it was seized by U.S. customs if it ever tried to enter this country, therefore being a fan of films considered \"controversial\" I really had to see this for myself.<br /><br />The plot is centered around a young Swedish drama student named Lena who wants to learn everything she can about life. In particular she wants to focus her attentions to making some sort of documentary on what the average Swede thought about certain political issues such as the Vietnam War and race issues in the United States. In between asking politicians and ordinary denizens of Stockholm about their opinions on politics, she has sex with her drama teacher, classmates, and married men.<br /><br />What kills me about I AM CURIOUS-YELLOW is that 40 years ago, this was considered pornographic. Really, the sex and nudity scenes are few and far between, even then it\\'s not shot like some cheaply made porno. While my countrymen mind find it shocking, in reality sex and nudity are a major staple in Swedish cinema. Even Ingmar Bergman, arguably their answer to good old boy John Ford, had sex scenes in his films.<br /><br />I do commend the filmmakers for the fact that any sex shown in the film is shown for artistic purposes rather than just to shock people and make money to be shown in pornographic theaters in America. I AM CURIOUS-YELLOW is a good film for anyone wanting to study the meat and potatoes (no pun intended) of Swedish cinema. But really, this film doesn\\'t have much of a plot.'"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "string"
            }
          },
          "metadata": {},
          "execution_count": 94
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "TRAIN_DATA_SIZE = len(train_data)\n",
        "for i in tqdm(range(TRAIN_DATA_SIZE)):\n",
        "  label, text = train_data[i]\n",
        "  processed_text = convert_to_paragraph(\n",
        "    word_lemmatizer(\n",
        "            remove_stopwords(\n",
        "                remove_punctuation(\n",
        "                    remove_html_tags(\n",
        "                        text)))))\n",
        "  train_data[i] = (label, processed_text)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "qE2WP11g7Q-j",
        "outputId": "0b19e042-fec7-4922-bfa9-08e3a1dc24dd"
      },
      "execution_count": 95,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "\n",
            "  0%|          | 0/25000 [00:00<?, ?it/s]\u001b[A\n",
            "  0%|          | 93/25000 [00:00<00:27, 903.08it/s]\u001b[A\n",
            "  1%|          | 184/25000 [00:00<00:35, 707.73it/s]\u001b[A\n",
            "  1%|          | 258/25000 [00:00<00:37, 658.64it/s]\u001b[A\n",
            "  1%|▏         | 326/25000 [00:00<00:39, 624.48it/s]\u001b[A\n",
            "  2%|▏         | 390/25000 [00:00<00:39, 626.55it/s]\u001b[A\n",
            "  2%|▏         | 454/25000 [00:00<00:40, 602.59it/s]\u001b[A\n",
            "  2%|▏         | 515/25000 [00:00<00:43, 556.95it/s]\u001b[A\n",
            "  2%|▏         | 572/25000 [00:00<00:45, 539.79it/s]\u001b[A\n",
            "  3%|▎         | 627/25000 [00:01<00:45, 529.91it/s]\u001b[A\n",
            "  3%|▎         | 681/25000 [00:01<00:47, 509.54it/s]\u001b[A\n",
            "  3%|▎         | 733/25000 [00:01<00:47, 510.23it/s]\u001b[A\n",
            "  3%|▎         | 785/25000 [00:01<00:49, 487.54it/s]\u001b[A\n",
            "  3%|▎         | 843/25000 [00:01<00:47, 512.42it/s]\u001b[A\n",
            "  4%|▎         | 906/25000 [00:01<00:44, 544.25it/s]\u001b[A\n",
            "  4%|▍         | 961/25000 [00:01<00:44, 545.46it/s]\u001b[A\n",
            "  4%|▍         | 1021/25000 [00:01<00:42, 558.37it/s]\u001b[A\n",
            "  4%|▍         | 1088/25000 [00:01<00:40, 590.03it/s]\u001b[A\n",
            "  5%|▍         | 1151/25000 [00:02<00:39, 600.97it/s]\u001b[A\n",
            "  5%|▍         | 1212/25000 [00:02<00:40, 592.53it/s]\u001b[A\n",
            "  5%|▌         | 1272/25000 [00:02<00:40, 580.66it/s]\u001b[A\n",
            "  5%|▌         | 1333/25000 [00:02<00:40, 587.03it/s]\u001b[A\n",
            "  6%|▌         | 1392/25000 [00:02<00:40, 585.79it/s]\u001b[A\n",
            "  6%|▌         | 1453/25000 [00:02<00:40, 586.03it/s]\u001b[A\n",
            "  6%|▌         | 1512/25000 [00:02<00:41, 566.95it/s]\u001b[A\n",
            "  6%|▋         | 1569/25000 [00:02<00:41, 565.63it/s]\u001b[A\n",
            "  7%|▋         | 1626/25000 [00:02<00:42, 554.52it/s]\u001b[A\n",
            "  7%|▋         | 1697/25000 [00:02<00:39, 597.38it/s]\u001b[A\n",
            "  7%|▋         | 1758/25000 [00:03<00:38, 599.41it/s]\u001b[A\n",
            "  7%|▋         | 1825/25000 [00:03<00:37, 615.84it/s]\u001b[A\n",
            "  8%|▊         | 1890/25000 [00:03<00:37, 623.85it/s]\u001b[A\n",
            "  8%|▊         | 1953/25000 [00:03<00:41, 559.51it/s]\u001b[A\n",
            "  8%|▊         | 2016/25000 [00:03<00:39, 577.03it/s]\u001b[A\n",
            "  8%|▊         | 2075/25000 [00:03<00:43, 524.90it/s]\u001b[A\n",
            "  9%|▊         | 2133/25000 [00:03<00:42, 539.39it/s]\u001b[A\n",
            "  9%|▉         | 2189/25000 [00:03<00:41, 543.76it/s]\u001b[A\n",
            "  9%|▉         | 2245/25000 [00:03<00:41, 546.17it/s]\u001b[A\n",
            "  9%|▉         | 2306/25000 [00:04<00:40, 558.72it/s]\u001b[A\n",
            "  9%|▉         | 2366/25000 [00:04<00:39, 567.36it/s]\u001b[A\n",
            " 10%|▉         | 2433/25000 [00:04<00:37, 595.61it/s]\u001b[A\n",
            " 10%|▉         | 2497/25000 [00:04<00:37, 606.91it/s]\u001b[A\n",
            " 10%|█         | 2558/25000 [00:04<00:37, 599.50it/s]\u001b[A\n",
            " 11%|█         | 2634/25000 [00:04<00:34, 644.15it/s]\u001b[A\n",
            " 11%|█         | 2699/25000 [00:04<00:35, 634.91it/s]\u001b[A\n",
            " 11%|█         | 2763/25000 [00:04<00:36, 603.49it/s]\u001b[A\n",
            " 11%|█▏        | 2834/25000 [00:04<00:35, 632.83it/s]\u001b[A\n",
            " 12%|█▏        | 2958/25000 [00:04<00:27, 807.60it/s]\u001b[A\n",
            " 12%|█▏        | 3046/25000 [00:05<00:26, 828.32it/s]\u001b[A\n",
            " 13%|█▎        | 3166/25000 [00:05<00:23, 935.40it/s]\u001b[A\n",
            " 13%|█▎        | 3265/25000 [00:05<00:22, 950.81it/s]\u001b[A\n",
            " 13%|█▎        | 3365/25000 [00:05<00:22, 961.81it/s]\u001b[A\n",
            " 14%|█▍        | 3478/25000 [00:05<00:21, 1010.20it/s]\u001b[A\n",
            " 14%|█▍        | 3583/25000 [00:05<00:21, 1019.19it/s]\u001b[A\n",
            " 15%|█▍        | 3686/25000 [00:05<00:21, 1012.46it/s]\u001b[A\n",
            " 15%|█▌        | 3788/25000 [00:05<00:21, 997.29it/s] \u001b[A\n",
            " 16%|█▌        | 3906/25000 [00:05<00:20, 1048.97it/s]\u001b[A\n",
            " 16%|█▌        | 4012/25000 [00:05<00:20, 1044.16it/s]\u001b[A\n",
            " 16%|█▋        | 4117/25000 [00:06<00:20, 1014.95it/s]\u001b[A\n",
            " 17%|█▋        | 4232/25000 [00:06<00:19, 1052.68it/s]\u001b[A\n",
            " 17%|█▋        | 4338/25000 [00:06<00:20, 1031.50it/s]\u001b[A\n",
            " 18%|█▊        | 4448/25000 [00:06<00:19, 1050.75it/s]\u001b[A\n",
            " 18%|█▊        | 4554/25000 [00:06<00:20, 1012.01it/s]\u001b[A\n",
            " 19%|█▊        | 4656/25000 [00:06<00:21, 934.72it/s] \u001b[A\n",
            " 19%|█▉        | 4752/25000 [00:06<00:21, 937.44it/s]\u001b[A\n",
            " 19%|█▉        | 4855/25000 [00:06<00:20, 961.45it/s]\u001b[A\n",
            " 20%|█▉        | 4952/25000 [00:06<00:20, 959.06it/s]\u001b[A\n",
            " 20%|██        | 5049/25000 [00:07<00:20, 959.35it/s]\u001b[A\n",
            " 21%|██        | 5151/25000 [00:07<00:20, 975.62it/s]\u001b[A\n",
            " 21%|██        | 5249/25000 [00:07<00:21, 932.82it/s]\u001b[A\n",
            " 21%|██▏       | 5360/25000 [00:07<00:20, 978.23it/s]\u001b[A\n",
            " 22%|██▏       | 5461/25000 [00:07<00:19, 986.98it/s]\u001b[A\n",
            " 22%|██▏       | 5561/25000 [00:07<00:20, 964.05it/s]\u001b[A\n",
            " 23%|██▎       | 5658/25000 [00:07<00:20, 964.23it/s]\u001b[A\n",
            " 23%|██▎       | 5756/25000 [00:07<00:19, 968.73it/s]\u001b[A\n",
            " 23%|██▎       | 5854/25000 [00:07<00:19, 968.84it/s]\u001b[A\n",
            " 24%|██▍       | 5952/25000 [00:07<00:19, 964.98it/s]\u001b[A\n",
            " 24%|██▍       | 6064/25000 [00:08<00:18, 1002.45it/s]\u001b[A\n",
            " 25%|██▍       | 6165/25000 [00:08<00:19, 991.15it/s] \u001b[A\n",
            " 25%|██▌       | 6265/25000 [00:08<00:19, 960.89it/s]\u001b[A\n",
            " 26%|██▌       | 6384/25000 [00:08<00:18, 1025.40it/s]\u001b[A\n",
            " 26%|██▌       | 6488/25000 [00:08<00:17, 1029.22it/s]\u001b[A\n",
            " 26%|██▋       | 6595/25000 [00:08<00:17, 1038.91it/s]\u001b[A\n",
            " 27%|██▋       | 6700/25000 [00:08<00:18, 1016.52it/s]\u001b[A\n",
            " 27%|██▋       | 6814/25000 [00:08<00:17, 1051.89it/s]\u001b[A\n",
            " 28%|██▊       | 6927/25000 [00:08<00:16, 1072.22it/s]\u001b[A\n",
            " 28%|██▊       | 7035/25000 [00:09<00:17, 1048.91it/s]\u001b[A\n",
            " 29%|██▊       | 7149/25000 [00:09<00:16, 1074.01it/s]\u001b[A\n",
            " 29%|██▉       | 7262/25000 [00:09<00:16, 1090.18it/s]\u001b[A\n",
            " 29%|██▉       | 7372/25000 [00:09<00:16, 1045.46it/s]\u001b[A\n",
            " 30%|██▉       | 7478/25000 [00:09<00:17, 1010.30it/s]\u001b[A\n",
            " 30%|███       | 7580/25000 [00:09<00:17, 1009.01it/s]\u001b[A\n",
            " 31%|███       | 7682/25000 [00:09<00:17, 1008.46it/s]\u001b[A\n",
            " 31%|███       | 7784/25000 [00:09<00:17, 1010.89it/s]\u001b[A\n",
            " 32%|███▏      | 7886/25000 [00:09<00:16, 1011.47it/s]\u001b[A\n",
            " 32%|███▏      | 7988/25000 [00:09<00:17, 962.48it/s] \u001b[A\n",
            " 32%|███▏      | 8085/25000 [00:10<00:17, 951.14it/s]\u001b[A\n",
            " 33%|███▎      | 8187/25000 [00:10<00:17, 969.67it/s]\u001b[A\n",
            " 33%|███▎      | 8298/25000 [00:10<00:16, 1006.58it/s]\u001b[A\n",
            " 34%|███▎      | 8399/25000 [00:10<00:17, 954.93it/s] \u001b[A\n",
            " 34%|███▍      | 8500/25000 [00:10<00:17, 966.49it/s]\u001b[A\n",
            " 34%|███▍      | 8612/25000 [00:10<00:16, 1010.53it/s]\u001b[A\n",
            " 35%|███▍      | 8728/25000 [00:10<00:15, 1053.36it/s]\u001b[A\n",
            " 35%|███▌      | 8843/25000 [00:10<00:14, 1079.67it/s]\u001b[A\n",
            " 36%|███▌      | 8952/25000 [00:10<00:15, 1035.75it/s]\u001b[A\n",
            " 36%|███▌      | 9060/25000 [00:11<00:15, 1045.08it/s]\u001b[A\n",
            " 37%|███▋      | 9165/25000 [00:11<00:15, 1022.05it/s]\u001b[A\n",
            " 37%|███▋      | 9270/25000 [00:11<00:15, 1029.61it/s]\u001b[A\n",
            " 38%|███▊      | 9376/25000 [00:11<00:15, 1033.34it/s]\u001b[A\n",
            " 38%|███▊      | 9480/25000 [00:11<00:15, 1022.08it/s]\u001b[A\n",
            " 38%|███▊      | 9590/25000 [00:11<00:14, 1043.47it/s]\u001b[A\n",
            " 39%|███▉      | 9705/25000 [00:11<00:14, 1072.40it/s]\u001b[A\n",
            " 39%|███▉      | 9816/25000 [00:11<00:14, 1078.86it/s]\u001b[A\n",
            " 40%|███▉      | 9924/25000 [00:11<00:14, 1070.54it/s]\u001b[A\n",
            " 40%|████      | 10034/25000 [00:11<00:13, 1079.19it/s]\u001b[A\n",
            " 41%|████      | 10142/25000 [00:12<00:14, 1059.93it/s]\u001b[A\n",
            " 41%|████      | 10254/25000 [00:12<00:13, 1076.67it/s]\u001b[A\n",
            " 41%|████▏     | 10366/25000 [00:12<00:13, 1087.18it/s]\u001b[A\n",
            " 42%|████▏     | 10475/25000 [00:12<00:13, 1062.07it/s]\u001b[A\n",
            " 42%|████▏     | 10582/25000 [00:12<00:13, 1057.17it/s]\u001b[A\n",
            " 43%|████▎     | 10688/25000 [00:12<00:13, 1041.68it/s]\u001b[A\n",
            " 43%|████▎     | 10804/25000 [00:12<00:13, 1074.07it/s]\u001b[A\n",
            " 44%|████▎     | 10920/25000 [00:12<00:12, 1089.99it/s]\u001b[A\n",
            " 44%|████▍     | 11030/25000 [00:12<00:13, 1056.61it/s]\u001b[A\n",
            " 45%|████▍     | 11136/25000 [00:12<00:13, 1032.13it/s]\u001b[A\n",
            " 45%|████▍     | 11242/25000 [00:13<00:13, 1038.51it/s]\u001b[A\n",
            " 45%|████▌     | 11347/25000 [00:13<00:13, 1023.04it/s]\u001b[A\n",
            " 46%|████▌     | 11450/25000 [00:13<00:13, 1010.03it/s]\u001b[A\n",
            " 46%|████▌     | 11552/25000 [00:13<00:13, 986.20it/s] \u001b[A\n",
            " 47%|████▋     | 11651/25000 [00:13<00:13, 986.73it/s]\u001b[A\n",
            " 47%|████▋     | 11757/25000 [00:13<00:13, 1007.32it/s]\u001b[A\n",
            " 47%|████▋     | 11866/25000 [00:13<00:12, 1031.04it/s]\u001b[A\n",
            " 48%|████▊     | 11970/25000 [00:13<00:12, 1014.15it/s]\u001b[A\n",
            " 48%|████▊     | 12072/25000 [00:13<00:12, 1004.55it/s]\u001b[A\n",
            " 49%|████▊     | 12173/25000 [00:14<00:12, 995.62it/s] \u001b[A\n",
            " 49%|████▉     | 12273/25000 [00:14<00:12, 982.37it/s]\u001b[A\n",
            " 50%|████▉     | 12391/25000 [00:14<00:12, 1039.75it/s]\u001b[A\n",
            " 50%|████▉     | 12497/25000 [00:14<00:12, 1039.99it/s]\u001b[A\n",
            " 50%|█████     | 12602/25000 [00:14<00:12, 993.35it/s] \u001b[A\n",
            " 51%|█████     | 12702/25000 [00:14<00:12, 980.94it/s]\u001b[A\n",
            " 51%|█████     | 12806/25000 [00:14<00:12, 997.78it/s]\u001b[A\n",
            " 52%|█████▏    | 12918/25000 [00:14<00:11, 1032.17it/s]\u001b[A\n",
            " 52%|█████▏    | 13023/25000 [00:14<00:11, 1036.24it/s]\u001b[A\n",
            " 53%|█████▎    | 13127/25000 [00:15<00:14, 802.32it/s] \u001b[A\n",
            " 53%|█████▎    | 13216/25000 [00:15<00:15, 773.49it/s]\u001b[A\n",
            " 53%|█████▎    | 13299/25000 [00:15<00:17, 672.71it/s]\u001b[A\n",
            " 53%|█████▎    | 13372/25000 [00:15<00:19, 601.35it/s]\u001b[A\n",
            " 54%|█████▎    | 13437/25000 [00:15<00:19, 606.07it/s]\u001b[A\n",
            " 54%|█████▍    | 13501/25000 [00:15<00:20, 562.05it/s]\u001b[A\n",
            " 54%|█████▍    | 13560/25000 [00:15<00:21, 531.50it/s]\u001b[A\n",
            " 54%|█████▍    | 13624/25000 [00:15<00:20, 556.77it/s]\u001b[A\n",
            " 55%|█████▍    | 13682/25000 [00:16<00:21, 533.45it/s]\u001b[A\n",
            " 55%|█████▍    | 13749/25000 [00:16<00:19, 567.79it/s]\u001b[A\n",
            " 55%|█████▌    | 13808/25000 [00:16<00:20, 536.38it/s]\u001b[A\n",
            " 55%|█████▌    | 13863/25000 [00:16<00:21, 523.17it/s]\u001b[A\n",
            " 56%|█████▌    | 13918/25000 [00:16<00:21, 524.03it/s]\u001b[A\n",
            " 56%|█████▌    | 13971/25000 [00:16<00:23, 471.02it/s]\u001b[A\n",
            " 56%|█████▌    | 14024/25000 [00:16<00:22, 484.27it/s]\u001b[A\n",
            " 56%|█████▋    | 14089/25000 [00:16<00:20, 527.86it/s]\u001b[A\n",
            " 57%|█████▋    | 14143/25000 [00:16<00:20, 523.26it/s]\u001b[A\n",
            " 57%|█████▋    | 14197/25000 [00:17<00:21, 506.31it/s]\u001b[A\n",
            " 57%|█████▋    | 14249/25000 [00:17<00:21, 506.19it/s]\u001b[A\n",
            " 57%|█████▋    | 14312/25000 [00:17<00:19, 540.74it/s]\u001b[A\n",
            " 57%|█████▋    | 14367/25000 [00:17<00:19, 536.74it/s]\u001b[A\n",
            " 58%|█████▊    | 14422/25000 [00:17<00:20, 505.18it/s]\u001b[A\n",
            " 58%|█████▊    | 14474/25000 [00:17<00:20, 502.15it/s]\u001b[A\n",
            " 58%|█████▊    | 14526/25000 [00:17<00:20, 506.25it/s]\u001b[A\n",
            " 58%|█████▊    | 14590/25000 [00:17<00:19, 543.84it/s]\u001b[A\n",
            " 59%|█████▊    | 14645/25000 [00:17<00:19, 530.88it/s]\u001b[A\n",
            " 59%|█████▉    | 14705/25000 [00:18<00:18, 546.25it/s]\u001b[A\n",
            " 59%|█████▉    | 14760/25000 [00:18<00:19, 536.85it/s]\u001b[A\n",
            " 59%|█████▉    | 14814/25000 [00:18<00:19, 531.81it/s]\u001b[A\n",
            " 59%|█████▉    | 14874/25000 [00:18<00:18, 548.19it/s]\u001b[A\n",
            " 60%|█████▉    | 14937/25000 [00:18<00:17, 570.71it/s]\u001b[A\n",
            " 60%|█████▉    | 14995/25000 [00:18<00:18, 540.95it/s]\u001b[A\n",
            " 60%|██████    | 15050/25000 [00:18<00:18, 536.21it/s]\u001b[A\n",
            " 60%|██████    | 15104/25000 [00:18<00:19, 520.75it/s]\u001b[A\n",
            " 61%|██████    | 15169/25000 [00:18<00:17, 556.21it/s]\u001b[A\n",
            " 61%|██████    | 15233/25000 [00:19<00:16, 576.79it/s]\u001b[A\n",
            " 61%|██████    | 15291/25000 [00:19<00:17, 570.83it/s]\u001b[A\n",
            " 61%|██████▏   | 15360/25000 [00:19<00:16, 600.47it/s]\u001b[A\n",
            " 62%|██████▏   | 15421/25000 [00:19<00:16, 578.03it/s]\u001b[A\n",
            " 62%|██████▏   | 15480/25000 [00:19<00:17, 552.70it/s]\u001b[A\n",
            " 62%|██████▏   | 15560/25000 [00:19<00:15, 619.69it/s]\u001b[A\n",
            " 63%|██████▎   | 15655/25000 [00:19<00:13, 711.39it/s]\u001b[A\n",
            " 63%|██████▎   | 15765/25000 [00:19<00:11, 821.27it/s]\u001b[A\n",
            " 64%|██████▎   | 15875/25000 [00:19<00:10, 899.28it/s]\u001b[A\n",
            " 64%|██████▍   | 15966/25000 [00:19<00:10, 895.73it/s]\u001b[A\n",
            " 64%|██████▍   | 16064/25000 [00:20<00:09, 919.20it/s]\u001b[A\n",
            " 65%|██████▍   | 16157/25000 [00:20<00:09, 904.55it/s]\u001b[A\n",
            " 65%|██████▌   | 16255/25000 [00:20<00:09, 924.09it/s]\u001b[A\n",
            " 65%|██████▌   | 16372/25000 [00:20<00:08, 993.30it/s]\u001b[A\n",
            " 66%|██████▌   | 16482/25000 [00:20<00:08, 1024.24it/s]\u001b[A\n",
            " 66%|██████▋   | 16585/25000 [00:20<00:08, 952.57it/s] \u001b[A\n",
            " 67%|██████▋   | 16682/25000 [00:20<00:10, 815.18it/s]\u001b[A\n",
            " 67%|██████▋   | 16768/25000 [00:21<00:14, 573.64it/s]\u001b[A\n",
            " 67%|██████▋   | 16838/25000 [00:21<00:14, 580.51it/s]\u001b[A\n",
            " 68%|██████▊   | 16905/25000 [00:21<00:14, 562.58it/s]\u001b[A\n",
            " 68%|██████▊   | 16968/25000 [00:21<00:15, 511.75it/s]\u001b[A\n",
            " 68%|██████▊   | 17024/25000 [00:21<00:15, 518.16it/s]\u001b[A\n",
            " 68%|██████▊   | 17082/25000 [00:21<00:14, 532.46it/s]\u001b[A\n",
            " 69%|██████▊   | 17143/25000 [00:21<00:14, 552.22it/s]\u001b[A\n",
            " 69%|██████▉   | 17202/25000 [00:21<00:13, 559.46it/s]\u001b[A\n",
            " 69%|██████▉   | 17260/25000 [00:21<00:14, 535.99it/s]\u001b[A\n",
            " 69%|██████▉   | 17315/25000 [00:22<00:15, 484.00it/s]\u001b[A\n",
            " 69%|██████▉   | 17371/25000 [00:22<00:15, 479.83it/s]\u001b[A\n",
            " 70%|██████▉   | 17421/25000 [00:22<00:17, 426.31it/s]\u001b[A\n",
            " 70%|██████▉   | 17470/25000 [00:22<00:17, 440.05it/s]\u001b[A\n",
            " 70%|███████   | 17527/25000 [00:22<00:15, 472.92it/s]\u001b[A\n",
            " 70%|███████   | 17588/25000 [00:22<00:14, 506.82it/s]\u001b[A\n",
            " 71%|███████   | 17649/25000 [00:22<00:13, 534.20it/s]\u001b[A\n",
            " 71%|███████   | 17705/25000 [00:22<00:13, 536.24it/s]\u001b[A\n",
            " 71%|███████   | 17760/25000 [00:23<00:15, 468.32it/s]\u001b[A\n",
            " 71%|███████   | 17809/25000 [00:23<00:15, 470.80it/s]\u001b[A\n",
            " 71%|███████▏  | 17869/25000 [00:23<00:14, 504.90it/s]\u001b[A\n",
            " 72%|███████▏  | 17921/25000 [00:23<00:14, 501.50it/s]\u001b[A\n",
            " 72%|███████▏  | 17973/25000 [00:23<00:16, 420.14it/s]\u001b[A\n",
            " 72%|███████▏  | 18018/25000 [00:23<00:23, 297.62it/s]\u001b[A\n",
            " 72%|███████▏  | 18055/25000 [00:24<00:28, 247.38it/s]\u001b[A\n",
            " 72%|███████▏  | 18086/25000 [00:24<00:29, 238.30it/s]\u001b[A\n",
            " 72%|███████▏  | 18117/25000 [00:24<00:27, 250.30it/s]\u001b[A\n",
            " 73%|███████▎  | 18211/25000 [00:24<00:17, 399.34it/s]\u001b[A\n",
            " 73%|███████▎  | 18319/25000 [00:24<00:11, 559.16it/s]\u001b[A\n",
            " 74%|███████▎  | 18430/25000 [00:24<00:09, 695.82it/s]\u001b[A\n",
            " 74%|███████▍  | 18537/25000 [00:24<00:08, 793.52it/s]\u001b[A\n",
            " 75%|███████▍  | 18630/25000 [00:24<00:07, 823.44it/s]\u001b[A\n",
            " 75%|███████▍  | 18719/25000 [00:24<00:07, 834.21it/s]\u001b[A\n",
            " 75%|███████▌  | 18834/25000 [00:24<00:06, 923.00it/s]\u001b[A\n",
            " 76%|███████▌  | 18952/25000 [00:25<00:06, 995.94it/s]\u001b[A\n",
            " 76%|███████▌  | 19056/25000 [00:25<00:05, 1005.31it/s]\u001b[A\n",
            " 77%|███████▋  | 19159/25000 [00:25<00:05, 978.59it/s] \u001b[A\n",
            " 77%|███████▋  | 19259/25000 [00:25<00:06, 956.82it/s]\u001b[A\n",
            " 77%|███████▋  | 19358/25000 [00:25<00:05, 958.76it/s]\u001b[A\n",
            " 78%|███████▊  | 19455/25000 [00:25<00:05, 929.29it/s]\u001b[A\n",
            " 78%|███████▊  | 19549/25000 [00:25<00:05, 915.14it/s]\u001b[A\n",
            " 79%|███████▊  | 19641/25000 [00:25<00:06, 860.13it/s]\u001b[A\n",
            " 79%|███████▉  | 19728/25000 [00:25<00:06, 840.36it/s]\u001b[A\n",
            " 79%|███████▉  | 19831/25000 [00:26<00:05, 891.37it/s]\u001b[A\n",
            " 80%|███████▉  | 19929/25000 [00:26<00:05, 915.96it/s]\u001b[A\n",
            " 80%|████████  | 20022/25000 [00:26<00:05, 870.75it/s]\u001b[A\n",
            " 81%|████████  | 20127/25000 [00:26<00:05, 920.12it/s]\u001b[A\n",
            " 81%|████████  | 20225/25000 [00:26<00:05, 935.64it/s]\u001b[A\n",
            " 81%|████████▏ | 20320/25000 [00:26<00:05, 935.30it/s]\u001b[A\n",
            " 82%|████████▏ | 20419/25000 [00:26<00:04, 947.68it/s]\u001b[A\n",
            " 82%|████████▏ | 20515/25000 [00:26<00:04, 920.05it/s]\u001b[A\n",
            " 82%|████████▏ | 20613/25000 [00:26<00:04, 936.88it/s]\u001b[A\n",
            " 83%|████████▎ | 20708/25000 [00:27<00:04, 918.88it/s]\u001b[A\n",
            " 83%|████████▎ | 20803/25000 [00:27<00:04, 921.82it/s]\u001b[A\n",
            " 84%|████████▎ | 20909/25000 [00:27<00:04, 960.73it/s]\u001b[A\n",
            " 84%|████████▍ | 21029/25000 [00:27<00:03, 1025.59it/s]\u001b[A\n",
            " 85%|████████▍ | 21132/25000 [00:27<00:03, 989.55it/s] \u001b[A\n",
            " 85%|████████▍ | 21234/25000 [00:27<00:03, 996.49it/s]\u001b[A\n",
            " 85%|████████▌ | 21334/25000 [00:27<00:03, 989.02it/s]\u001b[A\n",
            " 86%|████████▌ | 21434/25000 [00:27<00:03, 976.11it/s]\u001b[A\n",
            " 86%|████████▌ | 21532/25000 [00:27<00:03, 933.98it/s]\u001b[A\n",
            " 87%|████████▋ | 21626/25000 [00:27<00:03, 933.57it/s]\u001b[A\n",
            " 87%|████████▋ | 21729/25000 [00:28<00:03, 960.99it/s]\u001b[A\n",
            " 87%|████████▋ | 21831/25000 [00:28<00:03, 973.38it/s]\u001b[A\n",
            " 88%|████████▊ | 21929/25000 [00:28<00:03, 924.69it/s]\u001b[A\n",
            " 88%|████████▊ | 22023/25000 [00:28<00:03, 895.22it/s]\u001b[A\n",
            " 88%|████████▊ | 22123/25000 [00:28<00:03, 923.94it/s]\u001b[A\n",
            " 89%|████████▉ | 22246/25000 [00:28<00:02, 1011.00it/s]\u001b[A\n",
            " 89%|████████▉ | 22348/25000 [00:28<00:02, 1011.00it/s]\u001b[A\n",
            " 90%|████████▉ | 22450/25000 [00:28<00:02, 1009.93it/s]\u001b[A\n",
            " 90%|█████████ | 22552/25000 [00:28<00:02, 997.11it/s] \u001b[A\n",
            " 91%|█████████ | 22652/25000 [00:29<00:02, 970.06it/s]\u001b[A\n",
            " 91%|█████████ | 22750/25000 [00:29<00:02, 964.69it/s]\u001b[A\n",
            " 91%|█████████▏| 22847/25000 [00:29<00:02, 960.73it/s]\u001b[A\n",
            " 92%|█████████▏| 22954/25000 [00:29<00:02, 991.12it/s]\u001b[A\n",
            " 92%|█████████▏| 23055/25000 [00:29<00:01, 996.65it/s]\u001b[A\n",
            " 93%|█████████▎| 23159/25000 [00:29<00:01, 1007.91it/s]\u001b[A\n",
            " 93%|█████████▎| 23260/25000 [00:29<00:01, 899.29it/s] \u001b[A\n",
            " 93%|█████████▎| 23353/25000 [00:29<00:02, 821.95it/s]\u001b[A\n",
            " 94%|█████████▍| 23438/25000 [00:29<00:02, 712.26it/s]\u001b[A\n",
            " 94%|█████████▍| 23513/25000 [00:30<00:02, 661.16it/s]\u001b[A\n",
            " 94%|█████████▍| 23582/25000 [00:30<00:02, 624.42it/s]\u001b[A\n",
            " 95%|█████████▍| 23647/25000 [00:30<00:02, 589.82it/s]\u001b[A\n",
            " 95%|█████████▍| 23708/25000 [00:30<00:02, 575.61it/s]\u001b[A\n",
            " 95%|█████████▌| 23767/25000 [00:30<00:02, 537.74it/s]\u001b[A\n",
            " 95%|█████████▌| 23822/25000 [00:30<00:02, 520.07it/s]\u001b[A\n",
            " 96%|█████████▌| 23875/25000 [00:30<00:02, 490.34it/s]\u001b[A\n",
            " 96%|█████████▌| 23925/25000 [00:30<00:02, 469.72it/s]\u001b[A\n",
            " 96%|█████████▌| 23983/25000 [00:31<00:02, 494.24it/s]\u001b[A\n",
            " 96%|█████████▌| 24036/25000 [00:31<00:01, 503.23it/s]\u001b[A\n",
            " 96%|█████████▋| 24087/25000 [00:31<00:01, 504.24it/s]\u001b[A\n",
            " 97%|█████████▋| 24140/25000 [00:31<00:01, 510.30it/s]\u001b[A\n",
            " 97%|█████████▋| 24209/25000 [00:31<00:01, 560.59it/s]\u001b[A\n",
            " 97%|█████████▋| 24266/25000 [00:31<00:01, 561.32it/s]\u001b[A\n",
            " 97%|█████████▋| 24323/25000 [00:31<00:01, 554.02it/s]\u001b[A\n",
            " 98%|█████████▊| 24379/25000 [00:31<00:01, 552.82it/s]\u001b[A\n",
            " 98%|█████████▊| 24440/25000 [00:31<00:00, 568.63it/s]\u001b[A\n",
            " 98%|█████████▊| 24497/25000 [00:31<00:00, 546.30it/s]\u001b[A\n",
            " 98%|█████████▊| 24552/25000 [00:32<00:00, 538.17it/s]\u001b[A\n",
            " 98%|█████████▊| 24606/25000 [00:32<00:00, 503.53it/s]\u001b[A\n",
            " 99%|█████████▊| 24657/25000 [00:32<00:00, 505.30it/s]\u001b[A\n",
            " 99%|█████████▉| 24716/25000 [00:32<00:00, 529.25it/s]\u001b[A\n",
            " 99%|█████████▉| 24770/25000 [00:32<00:00, 496.77it/s]\u001b[A\n",
            " 99%|█████████▉| 24821/25000 [00:32<00:00, 489.50it/s]\u001b[A\n",
            "100%|█████████▉| 24877/25000 [00:32<00:00, 500.68it/s]\u001b[A\n",
            "100%|██████████| 25000/25000 [00:32<00:00, 758.80it/s]\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "TEST_DATA_SIZE = len(test_data)\n",
        "for i in tqdm(range(TEST_DATA_SIZE)):\n",
        "  label, text = test_data[i]\n",
        "  processed_text = convert_to_paragraph(\n",
        "    word_lemmatizer(\n",
        "        word_stemming(\n",
        "            remove_stopwords(\n",
        "                remove_punctuation(\n",
        "                    remove_html_tags(\n",
        "                        text))))))\n",
        "  test_data[i] = (label, processed_text)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "RAx9pSSS733_",
        "outputId": "7ab5cf41-74f3-41c3-f8dd-b91eafd5c81f"
      },
      "execution_count": 96,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "\n",
            "  0%|          | 0/25000 [00:00<?, ?it/s]\u001b[A\n",
            "  0%|          | 21/25000 [00:00<02:01, 206.24it/s]\u001b[A\n",
            "  0%|          | 42/25000 [00:00<02:14, 185.40it/s]\u001b[A\n",
            "  0%|          | 61/25000 [00:00<02:32, 163.07it/s]\u001b[A\n",
            "  0%|          | 78/25000 [00:00<02:35, 160.13it/s]\u001b[A\n",
            "  0%|          | 95/25000 [00:00<02:51, 145.12it/s]\u001b[A\n",
            "  0%|          | 113/25000 [00:00<02:41, 153.90it/s]\u001b[A\n",
            "  1%|          | 129/25000 [00:00<02:47, 148.70it/s]\u001b[A\n",
            "  1%|          | 145/25000 [00:00<02:50, 145.59it/s]\u001b[A\n",
            "  1%|          | 168/25000 [00:01<02:28, 167.03it/s]\u001b[A\n",
            "  1%|          | 190/25000 [00:01<02:17, 180.23it/s]\u001b[A\n",
            "  1%|          | 211/25000 [00:01<02:12, 187.48it/s]\u001b[A\n",
            "  1%|          | 230/25000 [00:01<02:15, 182.38it/s]\u001b[A\n",
            "  1%|          | 251/25000 [00:01<02:11, 188.05it/s]\u001b[A\n",
            "  1%|          | 281/25000 [00:01<01:52, 219.51it/s]\u001b[A\n",
            "  1%|▏         | 321/25000 [00:01<01:30, 271.47it/s]\u001b[A\n",
            "  1%|▏         | 354/25000 [00:01<01:26, 285.09it/s]\u001b[A\n",
            "  2%|▏         | 385/25000 [00:01<01:25, 288.51it/s]\u001b[A\n",
            "  2%|▏         | 415/25000 [00:02<01:30, 271.39it/s]\u001b[A\n",
            "  2%|▏         | 443/25000 [00:02<01:32, 265.18it/s]\u001b[A\n",
            "  2%|▏         | 476/25000 [00:02<01:26, 283.06it/s]\u001b[A\n",
            "  2%|▏         | 509/25000 [00:02<01:23, 294.30it/s]\u001b[A\n",
            "  2%|▏         | 539/25000 [00:02<01:27, 279.86it/s]\u001b[A\n",
            "  2%|▏         | 574/25000 [00:02<01:21, 297.97it/s]\u001b[A\n",
            "  2%|▏         | 609/25000 [00:02<01:18, 311.20it/s]\u001b[A\n",
            "  3%|▎         | 643/25000 [00:02<01:16, 318.70it/s]\u001b[A\n",
            "  3%|▎         | 679/25000 [00:02<01:14, 327.02it/s]\u001b[A\n",
            "  3%|▎         | 712/25000 [00:02<01:16, 317.25it/s]\u001b[A\n",
            "  3%|▎         | 744/25000 [00:03<01:20, 301.69it/s]\u001b[A\n",
            "  3%|▎         | 780/25000 [00:03<01:16, 316.91it/s]\u001b[A\n",
            "  3%|▎         | 812/25000 [00:03<01:23, 288.76it/s]\u001b[A\n",
            "  3%|▎         | 842/25000 [00:03<01:23, 287.65it/s]\u001b[A\n",
            "  3%|▎         | 872/25000 [00:03<01:25, 283.82it/s]\u001b[A\n",
            "  4%|▎         | 910/25000 [00:03<01:18, 308.84it/s]\u001b[A\n",
            "  4%|▍         | 942/25000 [00:03<01:20, 300.61it/s]\u001b[A\n",
            "  4%|▍         | 974/25000 [00:03<01:19, 303.38it/s]\u001b[A\n",
            "  4%|▍         | 1005/25000 [00:03<01:20, 296.53it/s]\u001b[A\n",
            "  4%|▍         | 1045/25000 [00:04<01:13, 325.23it/s]\u001b[A\n",
            "  4%|▍         | 1078/25000 [00:04<01:20, 297.07it/s]\u001b[A\n",
            "  4%|▍         | 1109/25000 [00:04<01:23, 285.71it/s]\u001b[A\n",
            "  5%|▍         | 1139/25000 [00:04<01:23, 285.01it/s]\u001b[A\n",
            "  5%|▍         | 1168/25000 [00:04<01:26, 276.39it/s]\u001b[A\n",
            "  5%|▍         | 1206/25000 [00:04<01:18, 304.52it/s]\u001b[A\n",
            "  5%|▍         | 1240/25000 [00:04<01:15, 312.83it/s]\u001b[A\n",
            "  5%|▌         | 1273/25000 [00:04<01:15, 314.37it/s]\u001b[A\n",
            "  5%|▌         | 1305/25000 [00:04<01:22, 286.18it/s]\u001b[A\n",
            "  5%|▌         | 1335/25000 [00:05<01:25, 277.98it/s]\u001b[A\n",
            "  5%|▌         | 1364/25000 [00:05<01:24, 280.50it/s]\u001b[A\n",
            "  6%|▌         | 1401/25000 [00:05<01:17, 304.36it/s]\u001b[A\n",
            "  6%|▌         | 1433/25000 [00:05<01:16, 307.18it/s]\u001b[A\n",
            "  6%|▌         | 1471/25000 [00:05<01:11, 327.35it/s]\u001b[A\n",
            "  6%|▌         | 1512/25000 [00:05<01:07, 348.08it/s]\u001b[A\n",
            "  6%|▌         | 1548/25000 [00:05<01:08, 341.14it/s]\u001b[A\n",
            "  6%|▋         | 1584/25000 [00:05<01:07, 344.59it/s]\u001b[A\n",
            "  6%|▋         | 1619/25000 [00:05<01:10, 332.95it/s]\u001b[A\n",
            "  7%|▋         | 1656/25000 [00:06<01:08, 341.21it/s]\u001b[A\n",
            "  7%|▋         | 1691/25000 [00:06<01:09, 335.53it/s]\u001b[A\n",
            "  7%|▋         | 1725/25000 [00:06<01:13, 316.68it/s]\u001b[A\n",
            "  7%|▋         | 1764/25000 [00:06<01:09, 335.17it/s]\u001b[A\n",
            "  7%|▋         | 1805/25000 [00:06<01:06, 346.37it/s]\u001b[A\n",
            "  7%|▋         | 1842/25000 [00:06<01:05, 352.11it/s]\u001b[A\n",
            "  8%|▊         | 1878/25000 [00:06<01:07, 344.18it/s]\u001b[A\n",
            "  8%|▊         | 1913/25000 [00:06<01:10, 326.59it/s]\u001b[A\n",
            "  8%|▊         | 1946/25000 [00:06<01:13, 314.27it/s]\u001b[A\n",
            "  8%|▊         | 1978/25000 [00:07<01:18, 291.43it/s]\u001b[A\n",
            "  8%|▊         | 2008/25000 [00:07<01:19, 290.65it/s]\u001b[A\n",
            "  8%|▊         | 2039/25000 [00:07<01:19, 290.59it/s]\u001b[A\n",
            "  8%|▊         | 2072/25000 [00:07<01:16, 300.83it/s]\u001b[A\n",
            "  8%|▊         | 2103/25000 [00:07<01:16, 298.16it/s]\u001b[A\n",
            "  9%|▊         | 2133/25000 [00:07<01:17, 294.71it/s]\u001b[A\n",
            "  9%|▊         | 2167/25000 [00:07<01:14, 306.35it/s]\u001b[A\n",
            "  9%|▉         | 2198/25000 [00:07<01:14, 304.91it/s]\u001b[A\n",
            "  9%|▉         | 2229/25000 [00:07<01:21, 280.70it/s]\u001b[A\n",
            "  9%|▉         | 2258/25000 [00:08<01:21, 277.88it/s]\u001b[A\n",
            "  9%|▉         | 2287/25000 [00:08<01:21, 277.31it/s]\u001b[A\n",
            "  9%|▉         | 2315/25000 [00:08<01:22, 274.35it/s]\u001b[A\n",
            "  9%|▉         | 2350/25000 [00:08<01:17, 291.45it/s]\u001b[A\n",
            " 10%|▉         | 2380/25000 [00:08<01:16, 293.79it/s]\u001b[A\n",
            " 10%|▉         | 2413/25000 [00:08<01:14, 304.22it/s]\u001b[A\n",
            " 10%|▉         | 2446/25000 [00:08<01:12, 310.01it/s]\u001b[A\n",
            " 10%|▉         | 2478/25000 [00:08<01:14, 302.18it/s]\u001b[A\n",
            " 10%|█         | 2509/25000 [00:08<01:18, 286.83it/s]\u001b[A\n",
            " 10%|█         | 2539/25000 [00:08<01:17, 289.40it/s]\u001b[A\n",
            " 10%|█         | 2571/25000 [00:09<01:15, 295.84it/s]\u001b[A\n",
            " 10%|█         | 2608/25000 [00:09<01:10, 315.84it/s]\u001b[A\n",
            " 11%|█         | 2642/25000 [00:09<01:09, 322.48it/s]\u001b[A\n",
            " 11%|█         | 2686/25000 [00:09<01:02, 356.58it/s]\u001b[A\n",
            " 11%|█         | 2722/25000 [00:09<01:02, 354.87it/s]\u001b[A\n",
            " 11%|█         | 2758/25000 [00:09<01:04, 344.48it/s]\u001b[A\n",
            " 11%|█         | 2793/25000 [00:09<01:08, 324.27it/s]\u001b[A\n",
            " 11%|█▏        | 2826/25000 [00:09<01:14, 297.44it/s]\u001b[A\n",
            " 11%|█▏        | 2857/25000 [00:09<01:17, 287.35it/s]\u001b[A\n",
            " 12%|█▏        | 2887/25000 [00:10<01:16, 288.67it/s]\u001b[A\n",
            " 12%|█▏        | 2928/25000 [00:10<01:08, 320.33it/s]\u001b[A\n",
            " 12%|█▏        | 2961/25000 [00:10<01:09, 316.28it/s]\u001b[A\n",
            " 12%|█▏        | 2993/25000 [00:10<01:12, 303.05it/s]\u001b[A\n",
            " 12%|█▏        | 3032/25000 [00:10<01:07, 326.48it/s]\u001b[A\n",
            " 12%|█▏        | 3066/25000 [00:10<01:07, 326.42it/s]\u001b[A\n",
            " 12%|█▏        | 3108/25000 [00:10<01:02, 352.96it/s]\u001b[A\n",
            " 13%|█▎        | 3144/25000 [00:10<01:04, 339.56it/s]\u001b[A\n",
            " 13%|█▎        | 3190/25000 [00:10<00:59, 369.53it/s]\u001b[A\n",
            " 13%|█▎        | 3228/25000 [00:11<01:03, 344.66it/s]\u001b[A\n",
            " 13%|█▎        | 3263/25000 [00:11<01:04, 336.57it/s]\u001b[A\n",
            " 13%|█▎        | 3300/25000 [00:11<01:02, 345.40it/s]\u001b[A\n",
            " 13%|█▎        | 3335/25000 [00:11<01:09, 311.21it/s]\u001b[A\n",
            " 13%|█▎        | 3367/25000 [00:11<01:14, 288.53it/s]\u001b[A\n",
            " 14%|█▎        | 3397/25000 [00:11<01:26, 249.75it/s]\u001b[A\n",
            " 14%|█▎        | 3424/25000 [00:11<01:39, 217.84it/s]\u001b[A\n",
            " 14%|█▍        | 3448/25000 [00:12<01:47, 200.55it/s]\u001b[A\n",
            " 14%|█▍        | 3469/25000 [00:12<01:47, 199.99it/s]\u001b[A\n",
            " 14%|█▍        | 3490/25000 [00:12<01:57, 182.93it/s]\u001b[A\n",
            " 14%|█▍        | 3509/25000 [00:12<01:57, 183.43it/s]\u001b[A\n",
            " 14%|█▍        | 3528/25000 [00:12<01:57, 182.73it/s]\u001b[A\n",
            " 14%|█▍        | 3547/25000 [00:12<02:15, 158.11it/s]\u001b[A\n",
            " 14%|█▍        | 3565/25000 [00:12<02:14, 159.45it/s]\u001b[A\n",
            " 14%|█▍        | 3584/25000 [00:12<02:08, 166.86it/s]\u001b[A\n",
            " 14%|█▍        | 3602/25000 [00:12<02:08, 166.62it/s]\u001b[A\n",
            " 14%|█▍        | 3625/25000 [00:13<02:01, 176.34it/s]\u001b[A\n",
            " 15%|█▍        | 3647/25000 [00:13<01:54, 186.66it/s]\u001b[A\n",
            " 15%|█▍        | 3666/25000 [00:13<02:06, 168.30it/s]\u001b[A\n",
            " 15%|█▍        | 3684/25000 [00:13<02:15, 156.75it/s]\u001b[A\n",
            " 15%|█▍        | 3707/25000 [00:13<02:02, 173.62it/s]\u001b[A\n",
            " 15%|█▍        | 3726/25000 [00:13<01:59, 177.84it/s]\u001b[A\n",
            " 15%|█▍        | 3745/25000 [00:13<02:00, 175.80it/s]\u001b[A\n",
            " 15%|█▌        | 3763/25000 [00:13<02:03, 172.48it/s]\u001b[A\n",
            " 15%|█▌        | 3781/25000 [00:13<02:06, 167.66it/s]\u001b[A\n",
            " 15%|█▌        | 3798/25000 [00:14<02:13, 158.64it/s]\u001b[A\n",
            " 15%|█▌        | 3815/25000 [00:14<02:18, 153.31it/s]\u001b[A\n",
            " 15%|█▌        | 3839/25000 [00:14<02:02, 173.21it/s]\u001b[A\n",
            " 15%|█▌        | 3857/25000 [00:14<02:03, 171.27it/s]\u001b[A\n",
            " 16%|█▌        | 3879/25000 [00:14<01:54, 183.95it/s]\u001b[A\n",
            " 16%|█▌        | 3900/25000 [00:14<01:50, 190.79it/s]\u001b[A\n",
            " 16%|█▌        | 3920/25000 [00:14<01:57, 180.04it/s]\u001b[A\n",
            " 16%|█▌        | 3939/25000 [00:14<02:00, 174.95it/s]\u001b[A\n",
            " 16%|█▌        | 3960/25000 [00:14<01:55, 182.94it/s]\u001b[A\n",
            " 16%|█▌        | 3979/25000 [00:15<02:04, 168.44it/s]\u001b[A\n",
            " 16%|█▌        | 3997/25000 [00:15<02:09, 162.35it/s]\u001b[A\n",
            " 16%|█▌        | 4014/25000 [00:15<02:12, 158.29it/s]\u001b[A\n",
            " 16%|█▌        | 4038/25000 [00:15<01:57, 178.20it/s]\u001b[A\n",
            " 16%|█▌        | 4058/25000 [00:15<01:54, 183.49it/s]\u001b[A\n",
            " 16%|█▋        | 4077/25000 [00:15<02:04, 168.37it/s]\u001b[A\n",
            " 16%|█▋        | 4099/25000 [00:15<01:56, 179.54it/s]\u001b[A\n",
            " 16%|█▋        | 4118/25000 [00:15<01:54, 181.90it/s]\u001b[A\n",
            " 17%|█▋        | 4137/25000 [00:16<02:01, 171.75it/s]\u001b[A\n",
            " 17%|█▋        | 4161/25000 [00:16<01:50, 188.50it/s]\u001b[A\n",
            " 17%|█▋        | 4181/25000 [00:16<01:56, 178.80it/s]\u001b[A\n",
            " 17%|█▋        | 4213/25000 [00:16<01:36, 214.32it/s]\u001b[A\n",
            " 17%|█▋        | 4247/25000 [00:16<01:24, 245.21it/s]\u001b[A\n",
            " 17%|█▋        | 4284/25000 [00:16<01:14, 278.71it/s]\u001b[A\n",
            " 17%|█▋        | 4321/25000 [00:16<01:08, 304.01it/s]\u001b[A\n",
            " 17%|█▋        | 4352/25000 [00:16<01:11, 289.12it/s]\u001b[A\n",
            " 18%|█▊        | 4382/25000 [00:16<01:14, 277.23it/s]\u001b[A\n",
            " 18%|█▊        | 4412/25000 [00:17<01:14, 277.27it/s]\u001b[A\n",
            " 18%|█▊        | 4448/25000 [00:17<01:08, 299.94it/s]\u001b[A\n",
            " 18%|█▊        | 4484/25000 [00:17<01:04, 316.96it/s]\u001b[A\n",
            " 18%|█▊        | 4523/25000 [00:17<01:00, 336.55it/s]\u001b[A\n",
            " 18%|█▊        | 4560/25000 [00:17<00:59, 344.61it/s]\u001b[A\n",
            " 18%|█▊        | 4595/25000 [00:17<01:00, 335.91it/s]\u001b[A\n",
            " 19%|█▊        | 4629/25000 [00:17<01:05, 312.63it/s]\u001b[A\n",
            " 19%|█▊        | 4661/25000 [00:17<01:05, 308.67it/s]\u001b[A\n",
            " 19%|█▉        | 4693/25000 [00:17<01:12, 280.77it/s]\u001b[A\n",
            " 19%|█▉        | 4726/25000 [00:18<01:09, 293.22it/s]\u001b[A\n",
            " 19%|█▉        | 4762/25000 [00:18<01:05, 310.30it/s]\u001b[A\n",
            " 19%|█▉        | 4801/25000 [00:18<01:00, 331.75it/s]\u001b[A\n",
            " 19%|█▉        | 4835/25000 [00:18<01:04, 312.13it/s]\u001b[A\n",
            " 19%|█▉        | 4867/25000 [00:18<01:18, 256.29it/s]\u001b[A\n",
            " 20%|█▉        | 4895/25000 [00:18<01:17, 259.15it/s]\u001b[A\n",
            " 20%|█▉        | 4930/25000 [00:18<01:12, 276.00it/s]\u001b[A\n",
            " 20%|█▉        | 4959/25000 [00:18<01:15, 264.64it/s]\u001b[A\n",
            " 20%|█▉        | 4993/25000 [00:18<01:10, 283.89it/s]\u001b[A\n",
            " 20%|██        | 5026/25000 [00:19<01:08, 292.46it/s]\u001b[A\n",
            " 20%|██        | 5058/25000 [00:19<01:06, 298.34it/s]\u001b[A\n",
            " 20%|██        | 5089/25000 [00:19<01:10, 283.03it/s]\u001b[A\n",
            " 20%|██        | 5123/25000 [00:19<01:06, 298.51it/s]\u001b[A\n",
            " 21%|██        | 5161/25000 [00:19<01:02, 319.45it/s]\u001b[A\n",
            " 21%|██        | 5194/25000 [00:19<01:04, 306.65it/s]\u001b[A\n",
            " 21%|██        | 5226/25000 [00:19<01:04, 305.78it/s]\u001b[A\n",
            " 21%|██        | 5257/25000 [00:19<01:06, 296.94it/s]\u001b[A\n",
            " 21%|██        | 5287/25000 [00:19<01:08, 288.88it/s]\u001b[A\n",
            " 21%|██▏       | 5317/25000 [00:20<01:10, 277.54it/s]\u001b[A\n",
            " 21%|██▏       | 5351/25000 [00:20<01:06, 294.30it/s]\u001b[A\n",
            " 22%|██▏       | 5389/25000 [00:20<01:02, 315.79it/s]\u001b[A\n",
            " 22%|██▏       | 5421/25000 [00:20<01:02, 312.93it/s]\u001b[A\n",
            " 22%|██▏       | 5462/25000 [00:20<00:57, 340.45it/s]\u001b[A\n",
            " 22%|██▏       | 5497/25000 [00:20<01:01, 318.29it/s]\u001b[A\n",
            " 22%|██▏       | 5530/25000 [00:20<01:01, 315.25it/s]\u001b[A\n",
            " 22%|██▏       | 5562/25000 [00:20<01:03, 304.93it/s]\u001b[A\n",
            " 22%|██▏       | 5593/25000 [00:20<01:07, 286.48it/s]\u001b[A\n",
            " 22%|██▏       | 5622/25000 [00:21<01:08, 284.48it/s]\u001b[A\n",
            " 23%|██▎       | 5651/25000 [00:21<01:07, 285.53it/s]\u001b[A\n",
            " 23%|██▎       | 5680/25000 [00:21<01:09, 278.50it/s]\u001b[A\n",
            " 23%|██▎       | 5712/25000 [00:21<01:07, 287.10it/s]\u001b[A\n",
            " 23%|██▎       | 5741/25000 [00:21<01:07, 283.61it/s]\u001b[A\n",
            " 23%|██▎       | 5770/25000 [00:21<01:08, 280.10it/s]\u001b[A\n",
            " 23%|██▎       | 5804/25000 [00:21<01:04, 295.74it/s]\u001b[A\n",
            " 23%|██▎       | 5836/25000 [00:21<01:03, 300.30it/s]\u001b[A\n",
            " 23%|██▎       | 5867/25000 [00:21<01:04, 296.48it/s]\u001b[A\n",
            " 24%|██▎       | 5897/25000 [00:21<01:06, 286.63it/s]\u001b[A\n",
            " 24%|██▎       | 5930/25000 [00:22<01:04, 297.65it/s]\u001b[A\n",
            " 24%|██▍       | 5960/25000 [00:22<01:06, 286.72it/s]\u001b[A\n",
            " 24%|██▍       | 5990/25000 [00:22<01:07, 283.09it/s]\u001b[A\n",
            " 24%|██▍       | 6021/25000 [00:22<01:05, 289.98it/s]\u001b[A\n",
            " 24%|██▍       | 6051/25000 [00:22<01:07, 282.12it/s]\u001b[A\n",
            " 24%|██▍       | 6081/25000 [00:22<01:06, 285.28it/s]\u001b[A\n",
            " 24%|██▍       | 6115/25000 [00:22<01:03, 299.33it/s]\u001b[A\n",
            " 25%|██▍       | 6150/25000 [00:22<01:00, 313.26it/s]\u001b[A\n",
            " 25%|██▍       | 6182/25000 [00:22<01:01, 304.00it/s]\u001b[A\n",
            " 25%|██▍       | 6219/25000 [00:23<00:58, 322.81it/s]\u001b[A\n",
            " 25%|██▌       | 6252/25000 [00:23<01:00, 308.35it/s]\u001b[A\n",
            " 25%|██▌       | 6286/25000 [00:23<00:59, 315.85it/s]\u001b[A\n",
            " 25%|██▌       | 6318/25000 [00:23<01:01, 306.03it/s]\u001b[A\n",
            " 25%|██▌       | 6351/25000 [00:23<01:00, 309.50it/s]\u001b[A\n",
            " 26%|██▌       | 6387/25000 [00:23<00:58, 319.44it/s]\u001b[A\n",
            " 26%|██▌       | 6423/25000 [00:23<00:56, 328.72it/s]\u001b[A\n",
            " 26%|██▌       | 6466/25000 [00:23<00:52, 355.90it/s]\u001b[A\n",
            " 26%|██▌       | 6502/25000 [00:23<00:54, 339.81it/s]\u001b[A\n",
            " 26%|██▌       | 6537/25000 [00:24<00:56, 328.86it/s]\u001b[A\n",
            " 26%|██▋       | 6583/25000 [00:24<00:50, 362.62it/s]\u001b[A\n",
            " 26%|██▋       | 6620/25000 [00:24<00:55, 328.74it/s]\u001b[A\n",
            " 27%|██▋       | 6654/25000 [00:24<00:55, 330.30it/s]\u001b[A\n",
            " 27%|██▋       | 6688/25000 [00:24<00:55, 332.24it/s]\u001b[A\n",
            " 27%|██▋       | 6731/25000 [00:24<00:51, 356.69it/s]\u001b[A\n",
            " 27%|██▋       | 6768/25000 [00:24<00:54, 332.67it/s]\u001b[A\n",
            " 27%|██▋       | 6802/25000 [00:24<00:55, 330.55it/s]\u001b[A\n",
            " 27%|██▋       | 6838/25000 [00:24<00:53, 338.41it/s]\u001b[A\n",
            " 27%|██▋       | 6873/25000 [00:25<00:54, 333.15it/s]\u001b[A\n",
            " 28%|██▊       | 6914/25000 [00:25<00:50, 354.65it/s]\u001b[A\n",
            " 28%|██▊       | 6954/25000 [00:25<00:49, 362.90it/s]\u001b[A\n",
            " 28%|██▊       | 6991/25000 [00:25<00:56, 321.40it/s]\u001b[A\n",
            " 28%|██▊       | 7026/25000 [00:25<00:54, 327.45it/s]\u001b[A\n",
            " 28%|██▊       | 7061/25000 [00:25<00:54, 331.47it/s]\u001b[A\n",
            " 28%|██▊       | 7095/25000 [00:25<00:57, 313.24it/s]\u001b[A\n",
            " 29%|██▊       | 7132/25000 [00:25<00:54, 326.32it/s]\u001b[A\n",
            " 29%|██▊       | 7166/25000 [00:25<00:57, 312.08it/s]\u001b[A\n",
            " 29%|██▉       | 7198/25000 [00:26<00:58, 304.80it/s]\u001b[A\n",
            " 29%|██▉       | 7229/25000 [00:26<01:02, 282.31it/s]\u001b[A\n",
            " 29%|██▉       | 7258/25000 [00:26<01:09, 256.31it/s]\u001b[A\n",
            " 29%|██▉       | 7285/25000 [00:26<01:10, 252.09it/s]\u001b[A\n",
            " 29%|██▉       | 7311/25000 [00:26<01:17, 229.06it/s]\u001b[A\n",
            " 29%|██▉       | 7335/25000 [00:26<01:29, 197.79it/s]\u001b[A\n",
            " 29%|██▉       | 7356/25000 [00:26<01:36, 183.63it/s]\u001b[A\n",
            " 30%|██▉       | 7375/25000 [00:27<01:46, 165.15it/s]\u001b[A\n",
            " 30%|██▉       | 7396/25000 [00:27<01:40, 174.76it/s]\u001b[A\n",
            " 30%|██▉       | 7415/25000 [00:27<01:41, 173.41it/s]\u001b[A\n",
            " 30%|██▉       | 7433/25000 [00:27<01:40, 174.41it/s]\u001b[A\n",
            " 30%|██▉       | 7451/25000 [00:27<01:47, 163.10it/s]\u001b[A\n",
            " 30%|██▉       | 7468/25000 [00:27<01:52, 155.78it/s]\u001b[A\n",
            " 30%|██▉       | 7486/25000 [00:27<01:48, 161.95it/s]\u001b[A\n",
            " 30%|███       | 7503/25000 [00:27<01:50, 158.41it/s]\u001b[A\n",
            " 30%|███       | 7527/25000 [00:27<01:39, 175.75it/s]\u001b[A\n",
            " 30%|███       | 7545/25000 [00:28<01:47, 162.46it/s]\u001b[A\n",
            " 30%|███       | 7562/25000 [00:28<01:58, 146.94it/s]\u001b[A\n",
            " 30%|███       | 7580/25000 [00:28<01:52, 154.41it/s]\u001b[A\n",
            " 30%|███       | 7596/25000 [00:28<01:56, 149.06it/s]\u001b[A\n",
            " 30%|███       | 7613/25000 [00:28<01:53, 153.72it/s]\u001b[A\n",
            " 31%|███       | 7632/25000 [00:28<01:46, 163.15it/s]\u001b[A\n",
            " 31%|███       | 7649/25000 [00:28<01:52, 154.06it/s]\u001b[A\n",
            " 31%|███       | 7668/25000 [00:28<01:46, 162.49it/s]\u001b[A\n",
            " 31%|███       | 7687/25000 [00:28<01:42, 168.87it/s]\u001b[A\n",
            " 31%|███       | 7705/25000 [00:29<01:41, 170.60it/s]\u001b[A\n",
            " 31%|███       | 7724/25000 [00:29<01:39, 174.40it/s]\u001b[A\n",
            " 31%|███       | 7742/25000 [00:29<01:44, 164.70it/s]\u001b[A\n",
            " 31%|███       | 7759/25000 [00:29<01:49, 157.10it/s]\u001b[A\n",
            " 31%|███       | 7775/25000 [00:29<01:51, 154.24it/s]\u001b[A\n",
            " 31%|███       | 7791/25000 [00:29<01:54, 150.16it/s]\u001b[A\n",
            " 31%|███       | 7807/25000 [00:29<01:54, 149.95it/s]\u001b[A\n",
            " 31%|███▏      | 7823/25000 [00:29<01:57, 145.96it/s]\u001b[A\n",
            " 31%|███▏      | 7848/25000 [00:29<01:39, 173.18it/s]\u001b[A\n",
            " 31%|███▏      | 7866/25000 [00:30<01:39, 171.99it/s]\u001b[A\n",
            " 32%|███▏      | 7884/25000 [00:30<01:39, 171.62it/s]\u001b[A\n",
            " 32%|███▏      | 7902/25000 [00:30<01:41, 168.88it/s]\u001b[A\n",
            " 32%|███▏      | 7925/25000 [00:30<01:32, 184.92it/s]\u001b[A\n",
            " 32%|███▏      | 7944/25000 [00:30<01:38, 172.85it/s]\u001b[A\n",
            " 32%|███▏      | 7962/25000 [00:30<01:39, 171.02it/s]\u001b[A\n",
            " 32%|███▏      | 7980/25000 [00:30<01:38, 171.99it/s]\u001b[A\n",
            " 32%|███▏      | 8004/25000 [00:30<01:29, 190.90it/s]\u001b[A\n",
            " 32%|███▏      | 8026/25000 [00:30<01:26, 196.87it/s]\u001b[A\n",
            " 32%|███▏      | 8046/25000 [00:31<01:30, 187.71it/s]\u001b[A\n",
            " 32%|███▏      | 8078/25000 [00:31<01:16, 221.51it/s]\u001b[A\n",
            " 32%|███▏      | 8101/25000 [00:31<01:15, 223.74it/s]\u001b[A\n",
            " 33%|███▎      | 8127/25000 [00:31<01:13, 230.99it/s]\u001b[A\n",
            " 33%|███▎      | 8159/25000 [00:31<01:06, 255.11it/s]\u001b[A\n",
            " 33%|███▎      | 8192/25000 [00:31<01:00, 275.83it/s]\u001b[A\n",
            " 33%|███▎      | 8221/25000 [00:31<01:01, 273.57it/s]\u001b[A\n",
            " 33%|███▎      | 8249/25000 [00:31<01:01, 271.69it/s]\u001b[A\n",
            " 33%|███▎      | 8282/25000 [00:31<00:58, 285.22it/s]\u001b[A\n",
            " 33%|███▎      | 8311/25000 [00:31<01:04, 257.25it/s]\u001b[A\n",
            " 33%|███▎      | 8345/25000 [00:32<00:59, 277.80it/s]\u001b[A\n",
            " 34%|███▎      | 8376/25000 [00:32<00:58, 285.82it/s]\u001b[A\n",
            " 34%|███▎      | 8406/25000 [00:32<00:58, 285.58it/s]\u001b[A\n",
            " 34%|███▎      | 8437/25000 [00:32<00:56, 292.05it/s]\u001b[A\n",
            " 34%|███▍      | 8467/25000 [00:32<00:57, 287.33it/s]\u001b[A\n",
            " 34%|███▍      | 8496/25000 [00:32<01:02, 265.78it/s]\u001b[A\n",
            " 34%|███▍      | 8531/25000 [00:32<00:57, 287.61it/s]\u001b[A\n",
            " 34%|███▍      | 8561/25000 [00:32<00:57, 287.76it/s]\u001b[A\n",
            " 34%|███▍      | 8591/25000 [00:32<00:56, 288.72it/s]\u001b[A\n",
            " 34%|███▍      | 8622/25000 [00:33<00:55, 294.71it/s]\u001b[A\n",
            " 35%|███▍      | 8655/25000 [00:33<00:53, 304.81it/s]\u001b[A\n",
            " 35%|███▍      | 8686/25000 [00:33<00:54, 299.15it/s]\u001b[A\n",
            " 35%|███▍      | 8717/25000 [00:33<00:54, 296.69it/s]\u001b[A\n",
            " 35%|███▍      | 8747/25000 [00:33<01:00, 267.21it/s]\u001b[A\n",
            " 35%|███▌      | 8778/25000 [00:33<00:58, 277.65it/s]\u001b[A\n",
            " 35%|███▌      | 8808/25000 [00:33<00:57, 283.80it/s]\u001b[A\n",
            " 35%|███▌      | 8843/25000 [00:33<00:53, 301.80it/s]\u001b[A\n",
            " 35%|███▌      | 8874/25000 [00:33<00:57, 279.98it/s]\u001b[A\n",
            " 36%|███▌      | 8908/25000 [00:34<00:54, 294.37it/s]\u001b[A\n",
            " 36%|███▌      | 8939/25000 [00:34<00:54, 296.92it/s]\u001b[A\n",
            " 36%|███▌      | 8970/25000 [00:34<00:56, 281.76it/s]\u001b[A\n",
            " 36%|███▌      | 8999/25000 [00:34<00:58, 272.50it/s]\u001b[A\n",
            " 36%|███▌      | 9027/25000 [00:34<01:00, 266.21it/s]\u001b[A\n",
            " 36%|███▌      | 9054/25000 [00:34<01:00, 265.03it/s]\u001b[A\n",
            " 36%|███▋      | 9092/25000 [00:34<00:53, 296.82it/s]\u001b[A\n",
            " 37%|███▋      | 9131/25000 [00:34<00:49, 323.10it/s]\u001b[A\n",
            " 37%|███▋      | 9164/25000 [00:34<00:49, 318.94it/s]\u001b[A\n",
            " 37%|███▋      | 9197/25000 [00:35<00:52, 299.54it/s]\u001b[A\n",
            " 37%|███▋      | 9232/25000 [00:35<00:50, 312.70it/s]\u001b[A\n",
            " 37%|███▋      | 9264/25000 [00:35<00:50, 314.04it/s]\u001b[A\n",
            " 37%|███▋      | 9296/25000 [00:35<00:50, 308.68it/s]\u001b[A\n",
            " 37%|███▋      | 9328/25000 [00:35<00:53, 292.21it/s]\u001b[A\n",
            " 37%|███▋      | 9365/25000 [00:35<00:49, 313.59it/s]\u001b[A\n",
            " 38%|███▊      | 9399/25000 [00:35<00:48, 319.45it/s]\u001b[A\n",
            " 38%|███▊      | 9439/25000 [00:35<00:45, 342.52it/s]\u001b[A\n",
            " 38%|███▊      | 9474/25000 [00:35<00:47, 328.52it/s]\u001b[A\n",
            " 38%|███▊      | 9508/25000 [00:36<00:51, 301.96it/s]\u001b[A\n",
            " 38%|███▊      | 9539/25000 [00:36<00:51, 302.32it/s]\u001b[A\n",
            " 38%|███▊      | 9576/25000 [00:36<00:48, 321.01it/s]\u001b[A\n",
            " 38%|███▊      | 9609/25000 [00:36<00:48, 316.87it/s]\u001b[A\n",
            " 39%|███▊      | 9641/25000 [00:36<00:52, 293.32it/s]\u001b[A\n",
            " 39%|███▊      | 9676/25000 [00:36<00:49, 306.82it/s]\u001b[A\n",
            " 39%|███▉      | 9708/25000 [00:36<00:50, 301.61it/s]\u001b[A\n",
            " 39%|███▉      | 9741/25000 [00:36<00:49, 306.96it/s]\u001b[A\n",
            " 39%|███▉      | 9772/25000 [00:36<00:53, 285.66it/s]\u001b[A\n",
            " 39%|███▉      | 9801/25000 [00:37<00:54, 278.30it/s]\u001b[A\n",
            " 39%|███▉      | 9835/25000 [00:37<00:52, 290.11it/s]\u001b[A\n",
            " 39%|███▉      | 9867/25000 [00:37<00:50, 298.16it/s]\u001b[A\n",
            " 40%|███▉      | 9898/25000 [00:37<00:54, 274.79it/s]\u001b[A\n",
            " 40%|███▉      | 9930/25000 [00:37<00:52, 285.69it/s]\u001b[A\n",
            " 40%|███▉      | 9960/25000 [00:37<00:53, 282.84it/s]\u001b[A\n",
            " 40%|███▉      | 9989/25000 [00:37<00:56, 266.33it/s]\u001b[A\n",
            " 40%|████      | 10029/25000 [00:37<00:50, 297.87it/s]\u001b[A\n",
            " 40%|████      | 10064/25000 [00:37<00:48, 310.20it/s]\u001b[A\n",
            " 40%|████      | 10096/25000 [00:38<00:50, 292.42it/s]\u001b[A\n",
            " 41%|████      | 10126/25000 [00:38<00:54, 275.05it/s]\u001b[A\n",
            " 41%|████      | 10161/25000 [00:38<00:50, 293.40it/s]\u001b[A\n",
            " 41%|████      | 10191/25000 [00:38<00:51, 289.97it/s]\u001b[A\n",
            " 41%|████      | 10222/25000 [00:38<00:50, 293.69it/s]\u001b[A\n",
            " 41%|████      | 10256/25000 [00:38<00:48, 306.60it/s]\u001b[A\n",
            " 41%|████      | 10290/25000 [00:38<00:46, 315.08it/s]\u001b[A\n",
            " 41%|████▏     | 10322/25000 [00:38<00:47, 309.85it/s]\u001b[A\n",
            " 41%|████▏     | 10354/25000 [00:38<00:48, 302.37it/s]\u001b[A\n",
            " 42%|████▏     | 10385/25000 [00:38<00:48, 301.55it/s]\u001b[A\n",
            " 42%|████▏     | 10416/25000 [00:39<00:50, 290.89it/s]\u001b[A\n",
            " 42%|████▏     | 10452/25000 [00:39<00:46, 309.79it/s]\u001b[A\n",
            " 42%|████▏     | 10484/25000 [00:39<00:47, 303.29it/s]\u001b[A\n",
            " 42%|████▏     | 10517/25000 [00:39<00:46, 309.57it/s]\u001b[A\n",
            " 42%|████▏     | 10551/25000 [00:39<00:45, 317.01it/s]\u001b[A\n",
            " 42%|████▏     | 10583/25000 [00:39<00:48, 298.69it/s]\u001b[A\n",
            " 42%|████▏     | 10622/25000 [00:39<00:44, 323.97it/s]\u001b[A\n",
            " 43%|████▎     | 10656/25000 [00:39<00:43, 327.42it/s]\u001b[A\n",
            " 43%|████▎     | 10690/25000 [00:39<00:43, 327.17it/s]\u001b[A\n",
            " 43%|████▎     | 10723/25000 [00:40<00:45, 312.59it/s]\u001b[A\n",
            " 43%|████▎     | 10755/25000 [00:40<00:46, 304.92it/s]\u001b[A\n",
            " 43%|████▎     | 10786/25000 [00:40<00:46, 303.56it/s]\u001b[A\n",
            " 43%|████▎     | 10817/25000 [00:40<00:46, 303.09it/s]\u001b[A\n",
            " 43%|████▎     | 10848/25000 [00:40<00:47, 299.91it/s]\u001b[A\n",
            " 44%|████▎     | 10882/25000 [00:40<00:45, 309.39it/s]\u001b[A\n",
            " 44%|████▎     | 10924/25000 [00:40<00:41, 341.35it/s]\u001b[A\n",
            " 44%|████▍     | 10959/25000 [00:40<00:41, 334.63it/s]\u001b[A\n",
            " 44%|████▍     | 10993/25000 [00:40<00:43, 322.05it/s]\u001b[A\n",
            " 44%|████▍     | 11026/25000 [00:41<00:50, 275.04it/s]\u001b[A\n",
            " 44%|████▍     | 11055/25000 [00:41<00:56, 247.48it/s]\u001b[A\n",
            " 44%|████▍     | 11081/25000 [00:41<01:05, 213.50it/s]\u001b[A\n",
            " 44%|████▍     | 11104/25000 [00:41<01:12, 191.48it/s]\u001b[A\n",
            " 44%|████▍     | 11125/25000 [00:41<01:17, 179.06it/s]\u001b[A\n",
            " 45%|████▍     | 11144/25000 [00:41<01:17, 179.91it/s]\u001b[A\n",
            " 45%|████▍     | 11163/25000 [00:41<01:16, 180.65it/s]\u001b[A\n",
            " 45%|████▍     | 11182/25000 [00:42<01:19, 173.54it/s]\u001b[A\n",
            " 45%|████▍     | 11200/25000 [00:42<01:22, 166.60it/s]\u001b[A\n",
            " 45%|████▍     | 11217/25000 [00:42<01:27, 157.52it/s]\u001b[A\n",
            " 45%|████▍     | 11233/25000 [00:42<01:29, 154.01it/s]\u001b[A\n",
            " 45%|████▍     | 11249/25000 [00:42<01:30, 152.32it/s]\u001b[A\n",
            " 45%|████▌     | 11272/25000 [00:42<01:19, 172.40it/s]\u001b[A\n",
            " 45%|████▌     | 11290/25000 [00:42<01:24, 163.11it/s]\u001b[A\n",
            " 45%|████▌     | 11307/25000 [00:42<01:25, 159.38it/s]\u001b[A\n",
            " 45%|████▌     | 11326/25000 [00:42<01:21, 167.38it/s]\u001b[A\n",
            " 45%|████▌     | 11354/25000 [00:43<01:10, 194.74it/s]\u001b[A\n",
            " 45%|████▌     | 11374/25000 [00:43<01:21, 167.27it/s]\u001b[A\n",
            " 46%|████▌     | 11392/25000 [00:43<01:24, 160.92it/s]\u001b[A\n",
            " 46%|████▌     | 11409/25000 [00:43<01:24, 161.25it/s]\u001b[A\n",
            " 46%|████▌     | 11429/25000 [00:43<01:19, 171.42it/s]\u001b[A\n",
            " 46%|████▌     | 11447/25000 [00:43<01:21, 165.39it/s]\u001b[A\n",
            " 46%|████▌     | 11465/25000 [00:43<01:20, 168.01it/s]\u001b[A\n",
            " 46%|████▌     | 11488/25000 [00:43<01:13, 182.61it/s]\u001b[A\n",
            " 46%|████▌     | 11507/25000 [00:43<01:18, 172.61it/s]\u001b[A\n",
            " 46%|████▌     | 11525/25000 [00:44<01:22, 163.06it/s]\u001b[A\n",
            " 46%|████▌     | 11542/25000 [00:44<01:27, 153.58it/s]\u001b[A\n",
            " 46%|████▌     | 11561/25000 [00:44<01:24, 159.56it/s]\u001b[A\n",
            " 46%|████▋     | 11578/25000 [00:44<01:27, 154.27it/s]\u001b[A\n",
            " 46%|████▋     | 11594/25000 [00:44<01:29, 149.51it/s]\u001b[A\n",
            " 46%|████▋     | 11619/25000 [00:44<01:17, 172.90it/s]\u001b[A\n",
            " 47%|████▋     | 11637/25000 [00:44<01:21, 164.21it/s]\u001b[A\n",
            " 47%|████▋     | 11654/25000 [00:44<01:20, 165.66it/s]\u001b[A\n",
            " 47%|████▋     | 11671/25000 [00:45<01:23, 159.93it/s]\u001b[A\n",
            " 47%|████▋     | 11688/25000 [00:45<01:28, 150.20it/s]\u001b[A\n",
            " 47%|████▋     | 11706/25000 [00:45<01:24, 156.69it/s]\u001b[A\n",
            " 47%|████▋     | 11723/25000 [00:45<01:23, 158.79it/s]\u001b[A\n",
            " 47%|████▋     | 11746/25000 [00:45<01:15, 175.81it/s]\u001b[A\n",
            " 47%|████▋     | 11768/25000 [00:45<01:11, 185.32it/s]\u001b[A\n",
            " 47%|████▋     | 11787/25000 [00:45<01:12, 181.75it/s]\u001b[A\n",
            " 47%|████▋     | 11806/25000 [00:45<01:17, 170.45it/s]\u001b[A\n",
            " 47%|████▋     | 11834/25000 [00:45<01:06, 197.51it/s]\u001b[A\n",
            " 47%|████▋     | 11863/25000 [00:46<00:59, 221.49it/s]\u001b[A\n",
            " 48%|████▊     | 11888/25000 [00:46<00:57, 229.21it/s]\u001b[A\n",
            " 48%|████▊     | 11922/25000 [00:46<00:50, 258.50it/s]\u001b[A\n",
            " 48%|████▊     | 11955/25000 [00:46<00:46, 278.44it/s]\u001b[A\n",
            " 48%|████▊     | 11984/25000 [00:46<00:48, 267.40it/s]\u001b[A\n",
            " 48%|████▊     | 12013/25000 [00:46<00:47, 271.40it/s]\u001b[A\n",
            " 48%|████▊     | 12051/25000 [00:46<00:42, 301.28it/s]\u001b[A\n",
            " 48%|████▊     | 12084/25000 [00:46<00:41, 308.68it/s]\u001b[A\n",
            " 48%|████▊     | 12122/25000 [00:46<00:39, 329.36it/s]\u001b[A\n",
            " 49%|████▊     | 12158/25000 [00:46<00:38, 337.36it/s]\u001b[A\n",
            " 49%|████▉     | 12196/25000 [00:47<00:36, 348.30it/s]\u001b[A\n",
            " 49%|████▉     | 12231/25000 [00:47<00:38, 335.47it/s]\u001b[A\n",
            " 49%|████▉     | 12267/25000 [00:47<00:37, 340.50it/s]\u001b[A\n",
            " 49%|████▉     | 12302/25000 [00:47<00:40, 312.54it/s]\u001b[A\n",
            " 49%|████▉     | 12334/25000 [00:47<00:41, 306.44it/s]\u001b[A\n",
            " 49%|████▉     | 12365/25000 [00:47<00:42, 298.32it/s]\u001b[A\n",
            " 50%|████▉     | 12404/25000 [00:47<00:38, 323.58it/s]\u001b[A\n",
            " 50%|████▉     | 12437/25000 [00:47<00:41, 299.50it/s]\u001b[A\n",
            " 50%|████▉     | 12468/25000 [00:47<00:43, 285.74it/s]\u001b[A\n",
            " 50%|████▉     | 12499/25000 [00:48<00:43, 288.84it/s]\u001b[A\n",
            " 50%|█████     | 12529/25000 [00:48<00:43, 285.26it/s]\u001b[A\n",
            " 50%|█████     | 12567/25000 [00:48<00:40, 309.33it/s]\u001b[A\n",
            " 50%|█████     | 12599/25000 [00:48<00:40, 306.73it/s]\u001b[A\n",
            " 51%|█████     | 12633/25000 [00:48<00:39, 314.49it/s]\u001b[A\n",
            " 51%|█████     | 12665/25000 [00:48<00:41, 296.78it/s]\u001b[A\n",
            " 51%|█████     | 12695/25000 [00:48<00:45, 270.91it/s]\u001b[A\n",
            " 51%|█████     | 12724/25000 [00:48<00:44, 275.17it/s]\u001b[A\n",
            " 51%|█████     | 12752/25000 [00:48<00:48, 252.96it/s]\u001b[A\n",
            " 51%|█████     | 12778/25000 [00:49<00:54, 226.16it/s]\u001b[A\n",
            " 51%|█████     | 12803/25000 [00:49<00:53, 228.54it/s]\u001b[A\n",
            " 51%|█████▏    | 12827/25000 [00:49<00:52, 230.60it/s]\u001b[A\n",
            " 51%|█████▏    | 12851/25000 [00:49<00:55, 219.75it/s]\u001b[A\n",
            " 52%|█████▏    | 12886/25000 [00:49<00:47, 253.89it/s]\u001b[A\n",
            " 52%|█████▏    | 12921/25000 [00:49<00:43, 278.73it/s]\u001b[A\n",
            " 52%|█████▏    | 12951/25000 [00:49<00:42, 283.95it/s]\u001b[A\n",
            " 52%|█████▏    | 12992/25000 [00:49<00:37, 318.92it/s]\u001b[A\n",
            " 52%|█████▏    | 13025/25000 [00:50<00:42, 282.03it/s]\u001b[A\n",
            " 52%|█████▏    | 13058/25000 [00:50<00:40, 294.57it/s]\u001b[A\n",
            " 52%|█████▏    | 13093/25000 [00:50<00:38, 309.21it/s]\u001b[A\n",
            " 53%|█████▎    | 13132/25000 [00:50<00:36, 325.44it/s]\u001b[A\n",
            " 53%|█████▎    | 13166/25000 [00:50<00:40, 295.58it/s]\u001b[A\n",
            " 53%|█████▎    | 13204/25000 [00:50<00:37, 313.41it/s]\u001b[A\n",
            " 53%|█████▎    | 13237/25000 [00:50<00:37, 315.81it/s]\u001b[A\n",
            " 53%|█████▎    | 13270/25000 [00:50<00:38, 300.88it/s]\u001b[A\n",
            " 53%|█████▎    | 13301/25000 [00:50<00:40, 291.61it/s]\u001b[A\n",
            " 53%|█████▎    | 13331/25000 [00:51<00:40, 285.09it/s]\u001b[A\n",
            " 53%|█████▎    | 13366/25000 [00:51<00:38, 302.50it/s]\u001b[A\n",
            " 54%|█████▎    | 13397/25000 [00:51<00:38, 298.32it/s]\u001b[A\n",
            " 54%|█████▎    | 13428/25000 [00:51<00:40, 283.53it/s]\u001b[A\n",
            " 54%|█████▍    | 13461/25000 [00:51<00:39, 295.87it/s]\u001b[A\n",
            " 54%|█████▍    | 13491/25000 [00:51<00:39, 294.29it/s]\u001b[A\n",
            " 54%|█████▍    | 13524/25000 [00:51<00:38, 296.32it/s]\u001b[A\n",
            " 54%|█████▍    | 13559/25000 [00:51<00:36, 311.12it/s]\u001b[A\n",
            " 54%|█████▍    | 13592/25000 [00:51<00:36, 314.26it/s]\u001b[A\n",
            " 54%|█████▍    | 13624/25000 [00:51<00:38, 297.03it/s]\u001b[A\n",
            " 55%|█████▍    | 13659/25000 [00:52<00:36, 311.66it/s]\u001b[A\n",
            " 55%|█████▍    | 13700/25000 [00:52<00:33, 339.70it/s]\u001b[A\n",
            " 55%|█████▍    | 13735/25000 [00:52<00:35, 314.24it/s]\u001b[A\n",
            " 55%|█████▌    | 13768/25000 [00:52<00:35, 314.84it/s]\u001b[A\n",
            " 55%|█████▌    | 13800/25000 [00:52<00:37, 295.93it/s]\u001b[A\n",
            " 55%|█████▌    | 13831/25000 [00:52<00:38, 292.31it/s]\u001b[A\n",
            " 55%|█████▌    | 13867/25000 [00:52<00:35, 310.59it/s]\u001b[A\n",
            " 56%|█████▌    | 13899/25000 [00:52<00:36, 308.05it/s]\u001b[A\n",
            " 56%|█████▌    | 13931/25000 [00:52<00:35, 309.80it/s]\u001b[A\n",
            " 56%|█████▌    | 13963/25000 [00:53<00:39, 279.01it/s]\u001b[A\n",
            " 56%|█████▌    | 13992/25000 [00:53<00:39, 280.04it/s]\u001b[A\n",
            " 56%|█████▌    | 14021/25000 [00:53<00:40, 268.13it/s]\u001b[A\n",
            " 56%|█████▌    | 14053/25000 [00:53<00:39, 279.10it/s]\u001b[A\n",
            " 56%|█████▋    | 14082/25000 [00:53<00:39, 274.62it/s]\u001b[A\n",
            " 56%|█████▋    | 14110/25000 [00:53<00:41, 264.35it/s]\u001b[A\n",
            " 57%|█████▋    | 14137/25000 [00:53<00:41, 261.23it/s]\u001b[A\n",
            " 57%|█████▋    | 14171/25000 [00:53<00:38, 281.05it/s]\u001b[A\n",
            " 57%|█████▋    | 14200/25000 [00:53<00:38, 277.96it/s]\u001b[A\n",
            " 57%|█████▋    | 14228/25000 [00:54<00:39, 269.55it/s]\u001b[A\n",
            " 57%|█████▋    | 14256/25000 [00:54<00:41, 259.50it/s]\u001b[A\n",
            " 57%|█████▋    | 14284/25000 [00:54<00:40, 264.97it/s]\u001b[A\n",
            " 57%|█████▋    | 14314/25000 [00:54<00:38, 274.23it/s]\u001b[A\n",
            " 57%|█████▋    | 14347/25000 [00:54<00:37, 287.67it/s]\u001b[A\n",
            " 58%|█████▊    | 14377/25000 [00:54<00:36, 289.89it/s]\u001b[A\n",
            " 58%|█████▊    | 14425/25000 [00:54<00:30, 343.60it/s]\u001b[A\n",
            " 58%|█████▊    | 14460/25000 [00:54<00:30, 342.75it/s]\u001b[A\n",
            " 58%|█████▊    | 14495/25000 [00:54<00:33, 317.90it/s]\u001b[A\n",
            " 58%|█████▊    | 14528/25000 [00:55<00:32, 320.46it/s]\u001b[A\n",
            " 58%|█████▊    | 14561/25000 [00:55<00:34, 303.23it/s]\u001b[A\n",
            " 58%|█████▊    | 14592/25000 [00:55<00:37, 277.66it/s]\u001b[A\n",
            " 59%|█████▊    | 14630/25000 [00:55<00:34, 303.52it/s]\u001b[A\n",
            " 59%|█████▊    | 14662/25000 [00:55<00:34, 299.34it/s]\u001b[A\n",
            " 59%|█████▉    | 14694/25000 [00:55<00:33, 303.45it/s]\u001b[A\n",
            " 59%|█████▉    | 14725/25000 [00:55<00:35, 288.50it/s]\u001b[A\n",
            " 59%|█████▉    | 14755/25000 [00:55<00:35, 285.63it/s]\u001b[A\n",
            " 59%|█████▉    | 14784/25000 [00:55<00:39, 258.43it/s]\u001b[A\n",
            " 59%|█████▉    | 14811/25000 [00:56<00:47, 212.37it/s]\u001b[A\n",
            " 59%|█████▉    | 14834/25000 [00:56<00:48, 210.42it/s]\u001b[A\n",
            " 59%|█████▉    | 14857/25000 [00:56<00:47, 211.44it/s]\u001b[A\n",
            " 60%|█████▉    | 14879/25000 [00:56<00:52, 193.59it/s]\u001b[A\n",
            " 60%|█████▉    | 14900/25000 [00:56<00:56, 180.13it/s]\u001b[A\n",
            " 60%|█████▉    | 14919/25000 [00:56<00:56, 179.56it/s]\u001b[A\n",
            " 60%|█████▉    | 14940/25000 [00:56<00:56, 179.62it/s]\u001b[A\n",
            " 60%|█████▉    | 14961/25000 [00:57<00:54, 185.83it/s]\u001b[A\n",
            " 60%|█████▉    | 14980/25000 [00:57<00:58, 170.52it/s]\u001b[A\n",
            " 60%|█████▉    | 14998/25000 [00:57<00:59, 168.41it/s]\u001b[A\n",
            " 60%|██████    | 15016/25000 [00:57<01:04, 154.82it/s]\u001b[A\n",
            " 60%|██████    | 15036/25000 [00:57<01:00, 164.17it/s]\u001b[A\n",
            " 60%|██████    | 15060/25000 [00:57<00:54, 181.24it/s]\u001b[A\n",
            " 60%|██████    | 15079/25000 [00:57<00:54, 182.94it/s]\u001b[A\n",
            " 60%|██████    | 15098/25000 [00:57<01:09, 142.86it/s]\u001b[A\n",
            " 60%|██████    | 15119/25000 [00:58<01:02, 157.84it/s]\u001b[A\n",
            " 61%|██████    | 15137/25000 [00:58<01:01, 161.68it/s]\u001b[A\n",
            " 61%|██████    | 15159/25000 [00:58<00:56, 174.95it/s]\u001b[A\n",
            " 61%|██████    | 15178/25000 [00:58<01:03, 154.85it/s]\u001b[A\n",
            " 61%|██████    | 15195/25000 [00:58<01:04, 151.04it/s]\u001b[A\n",
            " 61%|██████    | 15211/25000 [00:58<01:05, 148.91it/s]\u001b[A\n",
            " 61%|██████    | 15238/25000 [00:58<00:54, 179.21it/s]\u001b[A\n",
            " 61%|██████    | 15257/25000 [00:58<00:55, 174.13it/s]\u001b[A\n",
            " 61%|██████    | 15275/25000 [00:58<01:01, 156.86it/s]\u001b[A\n",
            " 61%|██████    | 15292/25000 [00:59<01:05, 149.12it/s]\u001b[A\n",
            " 61%|██████    | 15312/25000 [00:59<00:59, 161.86it/s]\u001b[A\n",
            " 61%|██████▏   | 15329/25000 [00:59<01:00, 160.42it/s]\u001b[A\n",
            " 61%|██████▏   | 15346/25000 [00:59<01:07, 143.89it/s]\u001b[A\n",
            " 61%|██████▏   | 15361/25000 [00:59<01:10, 137.49it/s]\u001b[A\n",
            " 62%|██████▏   | 15379/25000 [00:59<01:05, 146.54it/s]\u001b[A\n",
            " 62%|██████▏   | 15397/25000 [00:59<01:03, 152.06it/s]\u001b[A\n",
            " 62%|██████▏   | 15413/25000 [00:59<01:12, 133.03it/s]\u001b[A\n",
            " 62%|██████▏   | 15429/25000 [01:00<01:09, 138.37it/s]\u001b[A\n",
            " 62%|██████▏   | 15444/25000 [01:00<01:07, 141.26it/s]\u001b[A\n",
            " 62%|██████▏   | 15469/25000 [01:00<00:55, 170.72it/s]\u001b[A\n",
            " 62%|██████▏   | 15487/25000 [01:00<00:56, 167.81it/s]\u001b[A\n",
            " 62%|██████▏   | 15505/25000 [01:00<01:00, 157.47it/s]\u001b[A\n",
            " 62%|██████▏   | 15527/25000 [01:00<00:54, 173.34it/s]\u001b[A\n",
            " 62%|██████▏   | 15545/25000 [01:00<00:55, 171.49it/s]\u001b[A\n",
            " 62%|██████▏   | 15563/25000 [01:00<00:54, 172.36it/s]\u001b[A\n",
            " 62%|██████▏   | 15603/25000 [01:00<00:39, 236.64it/s]\u001b[A\n",
            " 63%|██████▎   | 15634/25000 [01:01<00:36, 257.61it/s]\u001b[A\n",
            " 63%|██████▎   | 15661/25000 [01:01<00:37, 251.74it/s]\u001b[A\n",
            " 63%|██████▎   | 15687/25000 [01:01<00:39, 234.12it/s]\u001b[A\n",
            " 63%|██████▎   | 15718/25000 [01:01<00:36, 252.80it/s]\u001b[A\n",
            " 63%|██████▎   | 15756/25000 [01:01<00:32, 288.21it/s]\u001b[A\n",
            " 63%|██████▎   | 15788/25000 [01:01<00:31, 293.71it/s]\u001b[A\n",
            " 63%|██████▎   | 15827/25000 [01:01<00:28, 321.17it/s]\u001b[A\n",
            " 63%|██████▎   | 15860/25000 [01:01<00:28, 315.44it/s]\u001b[A\n",
            " 64%|██████▎   | 15894/25000 [01:01<00:28, 319.89it/s]\u001b[A\n",
            " 64%|██████▎   | 15927/25000 [01:02<00:30, 301.16it/s]\u001b[A\n",
            " 64%|██████▍   | 15958/25000 [01:02<00:30, 298.32it/s]\u001b[A\n",
            " 64%|██████▍   | 15989/25000 [01:02<00:32, 274.99it/s]\u001b[A\n",
            " 64%|██████▍   | 16021/25000 [01:02<00:31, 286.45it/s]\u001b[A\n",
            " 64%|██████▍   | 16061/25000 [01:02<00:28, 317.13it/s]\u001b[A\n",
            " 64%|██████▍   | 16098/25000 [01:02<00:27, 329.12it/s]\u001b[A\n",
            " 65%|██████▍   | 16137/25000 [01:02<00:26, 337.91it/s]\u001b[A\n",
            " 65%|██████▍   | 16174/25000 [01:02<00:25, 342.58it/s]\u001b[A\n",
            " 65%|██████▍   | 16217/25000 [01:02<00:24, 361.58it/s]\u001b[A\n",
            " 65%|██████▌   | 16254/25000 [01:03<00:27, 321.03it/s]\u001b[A\n",
            " 65%|██████▌   | 16288/25000 [01:03<00:26, 324.12it/s]\u001b[A\n",
            " 65%|██████▌   | 16322/25000 [01:03<00:27, 318.60it/s]\u001b[A\n",
            " 65%|██████▌   | 16355/25000 [01:03<00:28, 305.62it/s]\u001b[A\n",
            " 66%|██████▌   | 16386/25000 [01:03<00:30, 280.88it/s]\u001b[A\n",
            " 66%|██████▌   | 16423/25000 [01:03<00:28, 303.13it/s]\u001b[A\n",
            " 66%|██████▌   | 16454/25000 [01:03<00:28, 303.20it/s]\u001b[A\n",
            " 66%|██████▌   | 16485/25000 [01:03<00:29, 293.08it/s]\u001b[A\n",
            " 66%|██████▌   | 16515/25000 [01:03<00:30, 276.99it/s]\u001b[A\n",
            " 66%|██████▌   | 16549/25000 [01:04<00:28, 293.83it/s]\u001b[A\n",
            " 66%|██████▋   | 16579/25000 [01:04<00:30, 279.14it/s]\u001b[A\n",
            " 66%|██████▋   | 16613/25000 [01:04<00:29, 284.86it/s]\u001b[A\n",
            " 67%|██████▋   | 16642/25000 [01:04<01:03, 130.76it/s]\u001b[A\n",
            " 67%|██████▋   | 16664/25000 [01:04<01:06, 125.09it/s]\u001b[A\n",
            " 67%|██████▋   | 16690/25000 [01:05<00:56, 146.11it/s]\u001b[A\n",
            " 67%|██████▋   | 16724/25000 [01:05<00:45, 181.63it/s]\u001b[A\n",
            " 67%|██████▋   | 16753/25000 [01:05<00:40, 203.09it/s]\u001b[A\n",
            " 67%|██████▋   | 16785/25000 [01:05<00:36, 227.05it/s]\u001b[A\n",
            " 67%|██████▋   | 16813/25000 [01:05<00:48, 167.71it/s]\u001b[A\n",
            " 67%|██████▋   | 16836/25000 [01:06<01:11, 113.57it/s]\u001b[A\n",
            " 67%|██████▋   | 16873/25000 [01:06<00:53, 150.98it/s]\u001b[A\n",
            " 68%|██████▊   | 16896/25000 [01:06<00:50, 161.41it/s]\u001b[A\n",
            " 68%|██████▊   | 16921/25000 [01:06<00:45, 178.41it/s]\u001b[A\n",
            " 68%|██████▊   | 16960/25000 [01:06<00:35, 224.59it/s]\u001b[A\n",
            " 68%|██████▊   | 16988/25000 [01:06<01:00, 132.23it/s]\u001b[A\n",
            " 68%|██████▊   | 17010/25000 [01:07<01:06, 120.01it/s]\u001b[A\n",
            " 68%|██████▊   | 17045/25000 [01:07<00:51, 155.76it/s]\u001b[A\n",
            " 68%|██████▊   | 17078/25000 [01:07<00:42, 186.76it/s]\u001b[A\n",
            " 68%|██████▊   | 17104/25000 [01:07<00:40, 197.03it/s]\u001b[A\n",
            " 69%|██████▊   | 17140/25000 [01:07<00:33, 232.87it/s]\u001b[A\n",
            " 69%|██████▊   | 17169/25000 [01:07<00:32, 237.64it/s]\u001b[A\n",
            " 69%|██████▉   | 17201/25000 [01:07<00:30, 257.23it/s]\u001b[A\n",
            " 69%|██████▉   | 17233/25000 [01:07<00:28, 273.52it/s]\u001b[A\n",
            " 69%|██████▉   | 17263/25000 [01:08<00:28, 267.45it/s]\u001b[A\n",
            " 69%|██████▉   | 17292/25000 [01:08<00:28, 267.22it/s]\u001b[A\n",
            " 69%|██████▉   | 17321/25000 [01:08<00:28, 273.35it/s]\u001b[A\n",
            " 69%|██████▉   | 17350/25000 [01:08<00:28, 266.36it/s]\u001b[A\n",
            " 70%|██████▉   | 17378/25000 [01:08<00:28, 269.44it/s]\u001b[A\n",
            " 70%|██████▉   | 17411/25000 [01:08<00:26, 285.62it/s]\u001b[A\n",
            " 70%|██████▉   | 17445/25000 [01:08<00:25, 299.86it/s]\u001b[A\n",
            " 70%|██████▉   | 17476/25000 [01:08<00:26, 286.50it/s]\u001b[A\n",
            " 70%|███████   | 17505/25000 [01:08<00:26, 282.97it/s]\u001b[A\n",
            " 70%|███████   | 17534/25000 [01:08<00:26, 282.07it/s]\u001b[A\n",
            " 70%|███████   | 17563/25000 [01:09<00:29, 253.45it/s]\u001b[A\n",
            " 70%|███████   | 17602/25000 [01:09<00:25, 289.12it/s]\u001b[A\n",
            " 71%|███████   | 17632/25000 [01:09<00:26, 276.18it/s]\u001b[A\n",
            " 71%|███████   | 17661/25000 [01:09<00:27, 268.70it/s]\u001b[A\n",
            " 71%|███████   | 17692/25000 [01:09<00:26, 278.32it/s]\u001b[A\n",
            " 71%|███████   | 17721/25000 [01:09<00:26, 271.87it/s]\u001b[A\n",
            " 71%|███████   | 17760/25000 [01:09<00:23, 304.16it/s]\u001b[A\n",
            " 71%|███████   | 17791/25000 [01:09<00:27, 264.76it/s]\u001b[A\n",
            " 71%|███████▏  | 17819/25000 [01:10<00:28, 256.35it/s]\u001b[A\n",
            " 71%|███████▏  | 17846/25000 [01:10<00:31, 227.07it/s]\u001b[A\n",
            " 72%|███████▏  | 17876/25000 [01:10<00:29, 243.74it/s]\u001b[A\n",
            " 72%|███████▏  | 17908/25000 [01:10<00:26, 262.87it/s]\u001b[A\n",
            " 72%|███████▏  | 17938/25000 [01:10<00:25, 271.63it/s]\u001b[A\n",
            " 72%|███████▏  | 17973/25000 [01:10<00:24, 288.00it/s]\u001b[A\n",
            " 72%|███████▏  | 18003/25000 [01:10<00:24, 291.31it/s]\u001b[A\n",
            " 72%|███████▏  | 18033/25000 [01:10<00:27, 250.06it/s]\u001b[A\n",
            " 72%|███████▏  | 18060/25000 [01:11<00:31, 219.60it/s]\u001b[A\n",
            " 72%|███████▏  | 18084/25000 [01:11<00:32, 209.90it/s]\u001b[A\n",
            " 72%|███████▏  | 18106/25000 [01:11<00:34, 201.46it/s]\u001b[A\n",
            " 73%|███████▎  | 18127/25000 [01:11<00:36, 189.98it/s]\u001b[A\n",
            " 73%|███████▎  | 18154/25000 [01:11<00:33, 201.80it/s]\u001b[A\n",
            " 73%|███████▎  | 18175/25000 [01:11<00:37, 182.89it/s]\u001b[A\n",
            " 73%|███████▎  | 18194/25000 [01:11<00:38, 178.15it/s]\u001b[A\n",
            " 73%|███████▎  | 18213/25000 [01:11<00:39, 169.68it/s]\u001b[A\n",
            " 73%|███████▎  | 18235/25000 [01:12<00:37, 182.31it/s]\u001b[A\n",
            " 73%|███████▎  | 18254/25000 [01:12<00:46, 145.81it/s]\u001b[A\n",
            " 73%|███████▎  | 18270/25000 [01:12<00:45, 146.64it/s]\u001b[A\n",
            " 73%|███████▎  | 18286/25000 [01:12<00:45, 146.77it/s]\u001b[A\n",
            " 73%|███████▎  | 18302/25000 [01:12<00:47, 141.94it/s]\u001b[A\n",
            " 73%|███████▎  | 18320/25000 [01:12<00:44, 148.56it/s]\u001b[A\n",
            " 73%|███████▎  | 18336/25000 [01:12<00:45, 147.96it/s]\u001b[A\n",
            " 73%|███████▎  | 18353/25000 [01:12<00:43, 151.83it/s]\u001b[A\n",
            " 73%|███████▎  | 18370/25000 [01:12<00:43, 153.05it/s]\u001b[A\n",
            " 74%|███████▎  | 18391/25000 [01:13<00:39, 168.28it/s]\u001b[A\n",
            " 74%|███████▎  | 18409/25000 [01:13<00:41, 157.97it/s]\u001b[A\n",
            " 74%|███████▎  | 18427/25000 [01:13<00:42, 155.52it/s]\u001b[A\n",
            " 74%|███████▍  | 18443/25000 [01:13<00:42, 156.01it/s]\u001b[A\n",
            " 74%|███████▍  | 18465/25000 [01:13<00:37, 172.31it/s]\u001b[A\n",
            " 74%|███████▍  | 18483/25000 [01:13<00:39, 163.35it/s]\u001b[A\n",
            " 74%|███████▍  | 18500/25000 [01:13<00:39, 163.85it/s]\u001b[A\n",
            " 74%|███████▍  | 18517/25000 [01:13<00:43, 149.25it/s]\u001b[A\n",
            " 74%|███████▍  | 18537/25000 [01:14<00:40, 161.43it/s]\u001b[A\n",
            " 74%|███████▍  | 18557/25000 [01:14<00:37, 169.76it/s]\u001b[A\n",
            " 74%|███████▍  | 18575/25000 [01:14<00:40, 158.33it/s]\u001b[A\n",
            " 74%|███████▍  | 18592/25000 [01:14<00:42, 151.30it/s]\u001b[A\n",
            " 74%|███████▍  | 18614/25000 [01:14<00:38, 168.04it/s]\u001b[A\n",
            " 75%|███████▍  | 18632/25000 [01:14<00:39, 161.65it/s]\u001b[A\n",
            " 75%|███████▍  | 18658/25000 [01:14<00:33, 187.44it/s]\u001b[A\n",
            " 75%|███████▍  | 18678/25000 [01:14<00:37, 168.69it/s]\u001b[A\n",
            " 75%|███████▍  | 18696/25000 [01:14<00:39, 159.66it/s]\u001b[A\n",
            " 75%|███████▍  | 18713/25000 [01:15<00:40, 153.72it/s]\u001b[A\n",
            " 75%|███████▍  | 18731/25000 [01:15<00:39, 158.27it/s]\u001b[A\n",
            " 75%|███████▍  | 18748/25000 [01:15<00:40, 153.61it/s]\u001b[A\n",
            " 75%|███████▌  | 18775/25000 [01:15<00:34, 181.51it/s]\u001b[A\n",
            " 75%|███████▌  | 18798/25000 [01:15<00:32, 193.54it/s]\u001b[A\n",
            " 75%|███████▌  | 18823/25000 [01:15<00:29, 207.20it/s]\u001b[A\n",
            " 75%|███████▌  | 18845/25000 [01:15<00:31, 198.53it/s]\u001b[A\n",
            " 75%|███████▌  | 18866/25000 [01:15<00:30, 200.76it/s]\u001b[A\n",
            " 76%|███████▌  | 18906/25000 [01:15<00:23, 255.65it/s]\u001b[A\n",
            " 76%|███████▌  | 18941/25000 [01:16<00:21, 277.23it/s]\u001b[A\n",
            " 76%|███████▌  | 18970/25000 [01:16<00:23, 252.55it/s]\u001b[A\n",
            " 76%|███████▌  | 19004/25000 [01:16<00:21, 273.55it/s]\u001b[A\n",
            " 76%|███████▌  | 19032/25000 [01:16<00:21, 274.60it/s]\u001b[A\n",
            " 76%|███████▌  | 19060/25000 [01:16<00:22, 269.93it/s]\u001b[A\n",
            " 76%|███████▋  | 19088/25000 [01:16<00:22, 265.28it/s]\u001b[A\n",
            " 76%|███████▋  | 19121/25000 [01:16<00:20, 280.66it/s]\u001b[A\n",
            " 77%|███████▋  | 19153/25000 [01:16<00:20, 291.24it/s]\u001b[A\n",
            " 77%|███████▋  | 19191/25000 [01:16<00:18, 315.94it/s]\u001b[A\n",
            " 77%|███████▋  | 19223/25000 [01:17<00:20, 287.41it/s]\u001b[A\n",
            " 77%|███████▋  | 19253/25000 [01:17<00:21, 267.08it/s]\u001b[A\n",
            " 77%|███████▋  | 19281/25000 [01:17<00:21, 263.99it/s]\u001b[A\n",
            " 77%|███████▋  | 19308/25000 [01:17<00:22, 251.63it/s]\u001b[A\n",
            " 77%|███████▋  | 19338/25000 [01:17<00:21, 261.53it/s]\u001b[A\n",
            " 78%|███████▊  | 19381/25000 [01:17<00:18, 307.47it/s]\u001b[A\n",
            " 78%|███████▊  | 19414/25000 [01:17<00:17, 312.86it/s]\u001b[A\n",
            " 78%|███████▊  | 19446/25000 [01:17<00:17, 308.90it/s]\u001b[A\n",
            " 78%|███████▊  | 19478/25000 [01:17<00:18, 294.18it/s]\u001b[A\n",
            " 78%|███████▊  | 19508/25000 [01:18<00:19, 287.02it/s]\u001b[A\n",
            " 78%|███████▊  | 19539/25000 [01:18<00:18, 290.53it/s]\u001b[A\n",
            " 78%|███████▊  | 19572/25000 [01:18<00:18, 300.18it/s]\u001b[A\n",
            " 78%|███████▊  | 19603/25000 [01:18<00:18, 284.68it/s]\u001b[A\n",
            " 79%|███████▊  | 19639/25000 [01:18<00:17, 302.47it/s]\u001b[A\n",
            " 79%|███████▊  | 19670/25000 [01:18<00:17, 296.29it/s]\u001b[A\n",
            " 79%|███████▉  | 19715/25000 [01:18<00:15, 337.26it/s]\u001b[A\n",
            " 79%|███████▉  | 19750/25000 [01:18<00:15, 339.85it/s]\u001b[A\n",
            " 79%|███████▉  | 19789/25000 [01:18<00:14, 351.58it/s]\u001b[A\n",
            " 79%|███████▉  | 19827/25000 [01:19<00:14, 358.75it/s]\u001b[A\n",
            " 79%|███████▉  | 19864/25000 [01:19<00:15, 341.78it/s]\u001b[A\n",
            " 80%|███████▉  | 19899/25000 [01:19<00:15, 337.01it/s]\u001b[A\n",
            " 80%|███████▉  | 19933/25000 [01:19<00:15, 327.19it/s]\u001b[A\n",
            " 80%|███████▉  | 19966/25000 [01:19<00:15, 316.82it/s]\u001b[A\n",
            " 80%|███████▉  | 19998/25000 [01:19<00:15, 316.06it/s]\u001b[A\n",
            " 80%|████████  | 20030/25000 [01:19<00:16, 299.91it/s]\u001b[A\n",
            " 80%|████████  | 20068/25000 [01:19<00:15, 321.64it/s]\u001b[A\n",
            " 80%|████████  | 20101/25000 [01:19<00:15, 323.75it/s]\u001b[A\n",
            " 81%|████████  | 20134/25000 [01:20<00:15, 320.84it/s]\u001b[A\n",
            " 81%|████████  | 20167/25000 [01:20<00:15, 315.54it/s]\u001b[A\n",
            " 81%|████████  | 20200/25000 [01:20<00:15, 318.11it/s]\u001b[A\n",
            " 81%|████████  | 20234/25000 [01:20<00:14, 321.39it/s]\u001b[A\n",
            " 81%|████████  | 20267/25000 [01:20<00:15, 313.66it/s]\u001b[A\n",
            " 81%|████████  | 20300/25000 [01:20<00:14, 317.15it/s]\u001b[A\n",
            " 81%|████████▏ | 20332/25000 [01:20<00:15, 294.52it/s]\u001b[A\n",
            " 81%|████████▏ | 20362/25000 [01:20<00:15, 295.75it/s]\u001b[A\n",
            " 82%|████████▏ | 20396/25000 [01:20<00:15, 301.66it/s]\u001b[A\n",
            " 82%|████████▏ | 20427/25000 [01:21<00:16, 280.56it/s]\u001b[A\n",
            " 82%|████████▏ | 20456/25000 [01:21<00:16, 267.92it/s]\u001b[A\n",
            " 82%|████████▏ | 20491/25000 [01:21<00:15, 289.40it/s]\u001b[A\n",
            " 82%|████████▏ | 20521/25000 [01:21<00:18, 247.54it/s]\u001b[A\n",
            " 82%|████████▏ | 20551/25000 [01:21<00:17, 259.56it/s]\u001b[A\n",
            " 82%|████████▏ | 20589/25000 [01:21<00:15, 289.76it/s]\u001b[A\n",
            " 83%|████████▎ | 20628/25000 [01:21<00:13, 316.94it/s]\u001b[A\n",
            " 83%|████████▎ | 20661/25000 [01:21<00:13, 316.06it/s]\u001b[A\n",
            " 83%|████████▎ | 20694/25000 [01:21<00:13, 311.37it/s]\u001b[A\n",
            " 83%|████████▎ | 20729/25000 [01:22<00:13, 322.18it/s]\u001b[A\n",
            " 83%|████████▎ | 20762/25000 [01:22<00:13, 321.16it/s]\u001b[A\n",
            " 83%|████████▎ | 20795/25000 [01:22<00:13, 316.90it/s]\u001b[A\n",
            " 83%|████████▎ | 20827/25000 [01:22<00:13, 311.02it/s]\u001b[A\n",
            " 83%|████████▎ | 20859/25000 [01:22<00:13, 301.07it/s]\u001b[A\n",
            " 84%|████████▎ | 20890/25000 [01:22<00:14, 280.82it/s]\u001b[A\n",
            " 84%|████████▎ | 20919/25000 [01:22<00:14, 278.91it/s]\u001b[A\n",
            " 84%|████████▍ | 20960/25000 [01:22<00:12, 314.35it/s]\u001b[A\n",
            " 84%|████████▍ | 20995/25000 [01:22<00:12, 316.35it/s]\u001b[A\n",
            " 84%|████████▍ | 21027/25000 [01:23<00:15, 259.83it/s]\u001b[A\n",
            " 84%|████████▍ | 21055/25000 [01:23<00:15, 246.76it/s]\u001b[A\n",
            " 84%|████████▍ | 21082/25000 [01:23<00:15, 251.92it/s]\u001b[A\n",
            " 84%|████████▍ | 21114/25000 [01:23<00:14, 269.19it/s]\u001b[A\n",
            " 85%|████████▍ | 21142/25000 [01:23<00:17, 222.81it/s]\u001b[A\n",
            " 85%|████████▍ | 21174/25000 [01:23<00:15, 245.14it/s]\u001b[A\n",
            " 85%|████████▍ | 21202/25000 [01:23<00:14, 253.35it/s]\u001b[A\n",
            " 85%|████████▍ | 21238/25000 [01:23<00:13, 281.33it/s]\u001b[A\n",
            " 85%|████████▌ | 21268/25000 [01:23<00:13, 277.99it/s]\u001b[A\n",
            " 85%|████████▌ | 21297/25000 [01:24<00:13, 275.45it/s]\u001b[A\n",
            " 85%|████████▌ | 21327/25000 [01:24<00:13, 280.68it/s]\u001b[A\n",
            " 85%|████████▌ | 21362/25000 [01:24<00:12, 299.99it/s]\u001b[A\n",
            " 86%|████████▌ | 21397/25000 [01:24<00:11, 313.64it/s]\u001b[A\n",
            " 86%|████████▌ | 21429/25000 [01:24<00:12, 297.10it/s]\u001b[A\n",
            " 86%|████████▌ | 21460/25000 [01:24<00:13, 271.61it/s]\u001b[A\n",
            " 86%|████████▌ | 21488/25000 [01:24<00:12, 273.14it/s]\u001b[A\n",
            " 86%|████████▌ | 21519/25000 [01:24<00:12, 282.83it/s]\u001b[A\n",
            " 86%|████████▌ | 21552/25000 [01:24<00:11, 294.74it/s]\u001b[A\n",
            " 86%|████████▋ | 21582/25000 [01:25<00:12, 276.75it/s]\u001b[A\n",
            " 86%|████████▋ | 21613/25000 [01:25<00:11, 285.81it/s]\u001b[A\n",
            " 87%|████████▋ | 21642/25000 [01:25<00:11, 286.46it/s]\u001b[A\n",
            " 87%|████████▋ | 21671/25000 [01:25<00:12, 269.45it/s]\u001b[A\n",
            " 87%|████████▋ | 21699/25000 [01:25<00:12, 268.58it/s]\u001b[A\n",
            " 87%|████████▋ | 21727/25000 [01:25<00:12, 270.46it/s]\u001b[A\n",
            " 87%|████████▋ | 21757/25000 [01:25<00:11, 275.73it/s]\u001b[A\n",
            " 87%|████████▋ | 21797/25000 [01:25<00:10, 307.64it/s]\u001b[A\n",
            " 87%|████████▋ | 21828/25000 [01:25<00:11, 276.13it/s]\u001b[A\n",
            " 87%|████████▋ | 21857/25000 [01:26<00:12, 247.00it/s]\u001b[A\n",
            " 88%|████████▊ | 21883/25000 [01:26<00:13, 225.73it/s]\u001b[A\n",
            " 88%|████████▊ | 21907/25000 [01:26<00:16, 191.38it/s]\u001b[A\n",
            " 88%|████████▊ | 21928/25000 [01:26<00:16, 183.25it/s]\u001b[A\n",
            " 88%|████████▊ | 21948/25000 [01:26<00:20, 149.71it/s]\u001b[A\n",
            " 88%|████████▊ | 21965/25000 [01:26<00:22, 134.35it/s]\u001b[A\n",
            " 88%|████████▊ | 21986/25000 [01:27<00:20, 149.10it/s]\u001b[A\n",
            " 88%|████████▊ | 22003/25000 [01:27<00:20, 148.56it/s]\u001b[A\n",
            " 88%|████████▊ | 22029/25000 [01:27<00:17, 173.77it/s]\u001b[A\n",
            " 88%|████████▊ | 22048/25000 [01:27<00:19, 154.34it/s]\u001b[A\n",
            " 88%|████████▊ | 22065/25000 [01:27<00:19, 149.30it/s]\u001b[A\n",
            " 88%|████████▊ | 22081/25000 [01:27<00:19, 147.15it/s]\u001b[A\n",
            " 88%|████████▊ | 22098/25000 [01:27<00:18, 152.90it/s]\u001b[A\n",
            " 88%|████████▊ | 22115/25000 [01:27<00:18, 154.40it/s]\u001b[A\n",
            " 89%|████████▊ | 22135/25000 [01:27<00:17, 163.11it/s]\u001b[A\n",
            " 89%|████████▊ | 22152/25000 [01:28<00:17, 159.62it/s]\u001b[A\n",
            " 89%|████████▊ | 22174/25000 [01:28<00:16, 172.53it/s]\u001b[A\n",
            " 89%|████████▉ | 22192/25000 [01:28<00:16, 170.93it/s]\u001b[A\n",
            " 89%|████████▉ | 22210/25000 [01:28<00:16, 164.29it/s]\u001b[A\n",
            " 89%|████████▉ | 22231/25000 [01:28<00:16, 171.34it/s]\u001b[A\n",
            " 89%|████████▉ | 22249/25000 [01:28<00:18, 151.74it/s]\u001b[A\n",
            " 89%|████████▉ | 22265/25000 [01:28<00:18, 151.46it/s]\u001b[A\n",
            " 89%|████████▉ | 22287/25000 [01:28<00:16, 168.97it/s]\u001b[A\n",
            " 89%|████████▉ | 22310/25000 [01:29<00:14, 185.00it/s]\u001b[A\n",
            " 89%|████████▉ | 22330/25000 [01:29<00:14, 184.73it/s]\u001b[A\n",
            " 89%|████████▉ | 22349/25000 [01:29<00:15, 169.95it/s]\u001b[A\n",
            " 89%|████████▉ | 22367/25000 [01:29<00:16, 163.35it/s]\u001b[A\n",
            " 90%|████████▉ | 22384/25000 [01:29<00:19, 135.80it/s]\u001b[A\n",
            " 90%|████████▉ | 22399/25000 [01:29<00:19, 135.65it/s]\u001b[A\n",
            " 90%|████████▉ | 22414/25000 [01:29<00:20, 128.56it/s]\u001b[A\n",
            " 90%|████████▉ | 22428/25000 [01:29<00:21, 120.32it/s]\u001b[A\n",
            " 90%|████████▉ | 22446/25000 [01:30<00:19, 134.20it/s]\u001b[A\n",
            " 90%|████████▉ | 22466/25000 [01:30<00:16, 150.08it/s]\u001b[A\n",
            " 90%|████████▉ | 22483/25000 [01:30<00:16, 153.40it/s]\u001b[A\n",
            " 90%|████████▉ | 22499/25000 [01:30<00:18, 138.73it/s]\u001b[A\n",
            " 90%|█████████ | 22517/25000 [01:30<00:16, 148.83it/s]\u001b[A\n",
            " 90%|█████████ | 22540/25000 [01:30<00:14, 169.88it/s]\u001b[A\n",
            " 90%|█████████ | 22558/25000 [01:30<00:15, 160.54it/s]\u001b[A\n",
            " 90%|█████████ | 22575/25000 [01:30<00:17, 138.93it/s]\u001b[A\n",
            " 90%|█████████ | 22590/25000 [01:30<00:17, 138.63it/s]\u001b[A\n",
            " 90%|█████████ | 22618/25000 [01:31<00:13, 173.79it/s]\u001b[A\n",
            " 91%|█████████ | 22647/25000 [01:31<00:11, 204.66it/s]\u001b[A\n",
            " 91%|█████████ | 22681/25000 [01:31<00:09, 237.25it/s]\u001b[A\n",
            " 91%|█████████ | 22706/25000 [01:31<00:09, 239.09it/s]\u001b[A\n",
            " 91%|█████████ | 22741/25000 [01:31<00:08, 268.82it/s]\u001b[A\n",
            " 91%|█████████ | 22771/25000 [01:31<00:08, 276.66it/s]\u001b[A\n",
            " 91%|█████████ | 22810/25000 [01:31<00:07, 307.89it/s]\u001b[A\n",
            " 91%|█████████▏| 22842/25000 [01:31<00:07, 292.66it/s]\u001b[A\n",
            " 91%|█████████▏| 22872/25000 [01:31<00:07, 283.90it/s]\u001b[A\n",
            " 92%|█████████▏| 22901/25000 [01:32<00:07, 273.23it/s]\u001b[A\n",
            " 92%|█████████▏| 22935/25000 [01:32<00:07, 291.46it/s]\u001b[A\n",
            " 92%|█████████▏| 22965/25000 [01:32<00:07, 290.39it/s]\u001b[A\n",
            " 92%|█████████▏| 22995/25000 [01:32<00:06, 292.41it/s]\u001b[A\n",
            " 92%|█████████▏| 23025/25000 [01:32<00:06, 291.60it/s]\u001b[A\n",
            " 92%|█████████▏| 23063/25000 [01:32<00:06, 316.83it/s]\u001b[A\n",
            " 92%|█████████▏| 23105/25000 [01:32<00:05, 346.65it/s]\u001b[A\n",
            " 93%|█████████▎| 23140/25000 [01:32<00:05, 327.94it/s]\u001b[A\n",
            " 93%|█████████▎| 23174/25000 [01:32<00:06, 282.40it/s]\u001b[A\n",
            " 93%|█████████▎| 23209/25000 [01:33<00:06, 298.36it/s]\u001b[A\n",
            " 93%|█████████▎| 23240/25000 [01:33<00:06, 293.26it/s]\u001b[A\n",
            " 93%|█████████▎| 23271/25000 [01:33<00:06, 285.05it/s]\u001b[A\n",
            " 93%|█████████▎| 23304/25000 [01:33<00:05, 295.26it/s]\u001b[A\n",
            " 93%|█████████▎| 23335/25000 [01:33<00:05, 286.54it/s]\u001b[A\n",
            " 93%|█████████▎| 23365/25000 [01:33<00:06, 267.04it/s]\u001b[A\n",
            " 94%|█████████▎| 23393/25000 [01:33<00:06, 267.51it/s]\u001b[A\n",
            " 94%|█████████▎| 23428/25000 [01:33<00:05, 287.80it/s]\u001b[A\n",
            " 94%|█████████▍| 23458/25000 [01:33<00:05, 287.10it/s]\u001b[A\n",
            " 94%|█████████▍| 23488/25000 [01:34<00:05, 288.70it/s]\u001b[A\n",
            " 94%|█████████▍| 23518/25000 [01:34<00:05, 288.56it/s]\u001b[A\n",
            " 94%|█████████▍| 23548/25000 [01:34<00:04, 290.58it/s]\u001b[A\n",
            " 94%|█████████▍| 23578/25000 [01:34<00:04, 290.62it/s]\u001b[A\n",
            " 94%|█████████▍| 23608/25000 [01:34<00:05, 271.92it/s]\u001b[A\n",
            " 95%|█████████▍| 23653/25000 [01:34<00:04, 320.81it/s]\u001b[A\n",
            " 95%|█████████▍| 23686/25000 [01:34<00:04, 301.22it/s]\u001b[A\n",
            " 95%|█████████▍| 23717/25000 [01:34<00:04, 291.73it/s]\u001b[A\n",
            " 95%|█████████▍| 23748/25000 [01:34<00:04, 292.66it/s]\u001b[A\n",
            " 95%|█████████▌| 23782/25000 [01:35<00:04, 303.93it/s]\u001b[A\n",
            " 95%|█████████▌| 23813/25000 [01:35<00:04, 288.92it/s]\u001b[A\n",
            " 95%|█████████▌| 23843/25000 [01:35<00:04, 282.06it/s]\u001b[A\n",
            " 95%|█████████▌| 23872/25000 [01:35<00:03, 283.34it/s]\u001b[A\n",
            " 96%|█████████▌| 23906/25000 [01:35<00:03, 299.11it/s]\u001b[A\n",
            " 96%|█████████▌| 23938/25000 [01:35<00:03, 304.25it/s]\u001b[A\n",
            " 96%|█████████▌| 23969/25000 [01:35<00:03, 295.30it/s]\u001b[A\n",
            " 96%|█████████▌| 23999/25000 [01:35<00:03, 294.47it/s]\u001b[A\n",
            " 96%|█████████▌| 24029/25000 [01:35<00:03, 285.15it/s]\u001b[A\n",
            " 96%|█████████▌| 24058/25000 [01:36<00:03, 271.62it/s]\u001b[A\n",
            " 96%|█████████▋| 24086/25000 [01:36<00:03, 245.12it/s]\u001b[A\n",
            " 96%|█████████▋| 24112/25000 [01:36<00:03, 235.45it/s]\u001b[A\n",
            " 97%|█████████▋| 24151/25000 [01:36<00:03, 274.65it/s]\u001b[A\n",
            " 97%|█████████▋| 24184/25000 [01:36<00:02, 286.12it/s]\u001b[A\n",
            " 97%|█████████▋| 24214/25000 [01:36<00:02, 287.78it/s]\u001b[A\n",
            " 97%|█████████▋| 24244/25000 [01:36<00:02, 273.44it/s]\u001b[A\n",
            " 97%|█████████▋| 24284/25000 [01:36<00:02, 306.92it/s]\u001b[A\n",
            " 97%|█████████▋| 24319/25000 [01:36<00:02, 317.63it/s]\u001b[A\n",
            " 97%|█████████▋| 24352/25000 [01:37<00:02, 310.95it/s]\u001b[A\n",
            " 98%|█████████▊| 24384/25000 [01:37<00:02, 306.94it/s]\u001b[A\n",
            " 98%|█████████▊| 24422/25000 [01:37<00:01, 325.88it/s]\u001b[A\n",
            " 98%|█████████▊| 24457/25000 [01:37<00:01, 328.98it/s]\u001b[A\n",
            " 98%|█████████▊| 24491/25000 [01:37<00:01, 323.30it/s]\u001b[A\n",
            " 98%|█████████▊| 24533/25000 [01:37<00:01, 346.09it/s]\u001b[A\n",
            " 98%|█████████▊| 24568/25000 [01:37<00:01, 321.16it/s]\u001b[A\n",
            " 98%|█████████▊| 24601/25000 [01:37<00:01, 295.86it/s]\u001b[A\n",
            " 99%|█████████▊| 24641/25000 [01:37<00:01, 323.07it/s]\u001b[A\n",
            " 99%|█████████▊| 24675/25000 [01:38<00:01, 316.29it/s]\u001b[A\n",
            " 99%|█████████▉| 24708/25000 [01:38<00:00, 305.37it/s]\u001b[A\n",
            " 99%|█████████▉| 24741/25000 [01:38<00:00, 311.68it/s]\u001b[A\n",
            " 99%|█████████▉| 24773/25000 [01:38<00:00, 303.51it/s]\u001b[A\n",
            " 99%|█████████▉| 24804/25000 [01:38<00:00, 270.78it/s]\u001b[A\n",
            " 99%|█████████▉| 24832/25000 [01:38<00:00, 225.82it/s]\u001b[A\n",
            " 99%|█████████▉| 24857/25000 [01:38<00:00, 190.68it/s]\u001b[A\n",
            "100%|█████████▉| 24878/25000 [01:39<00:00, 173.05it/s]\u001b[A\n",
            "100%|█████████▉| 24897/25000 [01:39<00:00, 166.96it/s]\u001b[A\n",
            "100%|█████████▉| 24915/25000 [01:39<00:00, 166.24it/s]\u001b[A\n",
            "100%|█████████▉| 24933/25000 [01:39<00:00, 160.19it/s]\u001b[A\n",
            "100%|█████████▉| 24950/25000 [01:39<00:00, 148.96it/s]\u001b[A\n",
            "100%|█████████▉| 24969/25000 [01:39<00:00, 158.71it/s]\u001b[A\n",
            "100%|██████████| 25000/25000 [01:39<00:00, 250.42it/s]\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Now that we have our corpus ready we can prepare the training features and the Label\n",
        "#### As we discussed Earlier in the chapter we will use a TF-IDF Vectorizer"
      ],
      "metadata": {
        "id": "f342_G6w9c2B"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from sklearn.feature_extraction.text import TfidfVectorizer\n",
        "from sklearn.preprocessing import OneHotEncoder"
      ],
      "metadata": {
        "id": "KQ_Rt6tC8dru"
      },
      "execution_count": 97,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "tfidf = TfidfVectorizer(ngram_range=(1, 1), max_features=1000)"
      ],
      "metadata": {
        "id": "LKJ1aMu__-n2"
      },
      "execution_count": 98,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "train_features_text = [sample[1] for sample in train_data]\n",
        "test_features_text = [sample[1] for sample in test_data]\n",
        "\n",
        "tfidf.fit(train_features_text)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 95
        },
        "id": "Ebod5ZP-_agP",
        "outputId": "c4821f8d-cf0f-4b97-931c-eb27e368ebc6"
      },
      "execution_count": 99,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "TfidfVectorizer(max_features=1000)"
            ],
            "text/html": [
              "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>TfidfVectorizer(max_features=1000)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">TfidfVectorizer</label><div class=\"sk-toggleable__content\"><pre>TfidfVectorizer(max_features=1000)</pre></div></div></div></div></div>"
            ]
          },
          "metadata": {},
          "execution_count": 99
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_features = tfidf.transform(train_features_text)\n",
        "test_features = tfidf.transform(test_features_text)"
      ],
      "metadata": {
        "id": "TChSBXNNAZ_c"
      },
      "execution_count": 100,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "ohe_enc = OneHotEncoder()"
      ],
      "metadata": {
        "id": "iYAacZaXA091"
      },
      "execution_count": 101,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "train_label_raw = [[sample[0]] for sample in train_data]\n",
        "test_label_raw = [[sample[0]] for sample in test_data]\n",
        "\n",
        "ohe_enc.fit(train_label_raw + test_label_raw)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 95
        },
        "id": "FbltltbuA5ce",
        "outputId": "fc84692d-6e94-435b-9367-7c4509bb98f3"
      },
      "execution_count": 102,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "OneHotEncoder()"
            ],
            "text/html": [
              "<style>#sk-container-id-2 {color: black;background-color: white;}#sk-container-id-2 pre{padding: 0;}#sk-container-id-2 div.sk-toggleable {background-color: white;}#sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-2 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-2 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-2 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-2 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-2 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-2 div.sk-item {position: relative;z-index: 1;}#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-2 div.sk-item::before, #sk-container-id-2 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-2 div.sk-label-container {text-align: center;}#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-2 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-2\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>OneHotEncoder()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" checked><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">OneHotEncoder</label><div class=\"sk-toggleable__content\"><pre>OneHotEncoder()</pre></div></div></div></div></div>"
            ]
          },
          "metadata": {},
          "execution_count": 102
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_label = ohe_enc.transform(train_label_raw)\n",
        "test_label = ohe_enc.transform(test_label_raw)"
      ],
      "metadata": {
        "id": "fV_Xvsn6BHhX"
      },
      "execution_count": 103,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "train_features.shape, train_label.shape"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "npf2ntFMBQZq",
        "outputId": "004b08e6-3488-4911-94a4-702a369d6b18"
      },
      "execution_count": 104,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "((25000, 1000), (25000, 2))"
            ]
          },
          "metadata": {},
          "execution_count": 104
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Words Associated to each Feature Index"
      ],
      "metadata": {
        "id": "SkbhNOR2DSww"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "tfidf.get_feature_names_out()"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "eiuef9-rBRtP",
        "outputId": "743be446-b184-4ebc-f150-34d121ac9ce7"
      },
      "execution_count": 105,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "array(['ability', 'able', 'absolutely', 'accent', 'across', 'act',\n",
              "       'acted', 'acting', 'action', 'actor', 'actress', 'actual',\n",
              "       'actually', 'adaptation', 'add', 'admit', 'adult', 'adventure',\n",
              "       'age', 'ago', 'agree', 'air', 'alien', 'almost', 'alone', 'along',\n",
              "       'already', 'also', 'although', 'always', 'amazing', 'america',\n",
              "       'american', 'among', 'amount', 'amusing', 'animal', 'animated',\n",
              "       'animation', 'annoying', 'another', 'answer', 'anyone', 'anything',\n",
              "       'anyway', 'apart', 'apparently', 'appeal', 'appear', 'appearance',\n",
              "       'appears', 'appreciate', 'around', 'art', 'artist', 'ask',\n",
              "       'aspect', 'atmosphere', 'attack', 'attempt', 'attention',\n",
              "       'audience', 'average', 'avoid', 'award', 'away', 'awful', 'baby',\n",
              "       'back', 'background', 'bad', 'badly', 'band', 'based', 'basic',\n",
              "       'basically', 'battle', 'beautiful', 'beauty', 'became', 'become',\n",
              "       'becomes', 'begin', 'beginning', 'behind', 'belief', 'believable',\n",
              "       'believe', 'ben', 'best', 'better', 'beyond', 'big', 'biggest',\n",
              "       'bill', 'bit', 'bizarre', 'black', 'blood', 'blue', 'body', 'book',\n",
              "       'bored', 'boring', 'box', 'boy', 'brain', 'break', 'brilliant',\n",
              "       'bring', 'brings', 'british', 'brother', 'brought', 'budget',\n",
              "       'bunch', 'business', 'buy', 'call', 'called', 'came', 'camera',\n",
              "       'cannot', 'capture', 'car', 'care', 'career', 'cartoon', 'case',\n",
              "       'cast', 'casting', 'cat', 'catch', 'caught', 'cause', 'century',\n",
              "       'certain', 'certainly', 'chance', 'change', 'channel', 'character',\n",
              "       'chase', 'cheap', 'check', 'cheesy', 'child', 'choice',\n",
              "       'christmas', 'cinema', 'cinematography', 'city', 'class',\n",
              "       'classic', 'clear', 'clearly', 'clever', 'close', 'co', 'cold',\n",
              "       'college', 'color', 'come', 'comedy', 'comic', 'coming', 'comment',\n",
              "       'common', 'company', 'compared', 'complete', 'completely',\n",
              "       'computer', 'concept', 'conclusion', 'consider', 'considering',\n",
              "       'control', 'convincing', 'cool', 'cop', 'copy', 'costume', 'could',\n",
              "       'country', 'couple', 'course', 'cover', 'crap', 'crazy', 'create',\n",
              "       'created', 'creature', 'credit', 'creepy', 'crew', 'crime',\n",
              "       'critic', 'cry', 'cult', 'culture', 'cut', 'cute', 'dad', 'dance',\n",
              "       'dancing', 'dark', 'date', 'daughter', 'david', 'day', 'de',\n",
              "       'dead', 'deal', 'death', 'decent', 'decided', 'decides', 'deep',\n",
              "       'definitely', 'depth', 'deserves', 'despite', 'detail',\n",
              "       'detective', 'development', 'dialog', 'dialogue', 'die', 'died',\n",
              "       'different', 'difficult', 'directed', 'directing', 'direction',\n",
              "       'director', 'disappointed', 'disney', 'doctor', 'documentary',\n",
              "       'dog', 'done', 'door', 'doubt', 'dr', 'drama', 'dramatic', 'dream',\n",
              "       'drive', 'drug', 'due', 'dull', 'dumb', 'dvd', 'earlier', 'early',\n",
              "       'earth', 'easily', 'easy', 'editing', 'effect', 'effective',\n",
              "       'effort', 'either', 'element', 'else', 'emotion', 'emotional',\n",
              "       'end', 'ended', 'ending', 'english', 'enjoy', 'enjoyable',\n",
              "       'enjoyed', 'enough', 'entertaining', 'entertainment', 'entire',\n",
              "       'entirely', 'episode', 'era', 'escape', 'especially', 'etc',\n",
              "       'even', 'event', 'eventually', 'ever', 'every', 'everyone',\n",
              "       'everything', 'evil', 'exactly', 'example', 'excellent', 'except',\n",
              "       'exciting', 'expect', 'expected', 'expecting', 'experience',\n",
              "       'extra', 'extremely', 'eye', 'face', 'fact', 'fails', 'fairly',\n",
              "       'fall', 'familiar', 'family', 'famous', 'fan', 'fantastic',\n",
              "       'fantasy', 'far', 'fast', 'father', 'favorite', 'fear', 'feature',\n",
              "       'feel', 'feeling', 'felt', 'female', 'fi', 'fight', 'fighting',\n",
              "       'figure', 'filled', 'film', 'filmed', 'filmmaker', 'final',\n",
              "       'finally', 'find', 'fine', 'fire', 'first', 'fit', 'five', 'flat',\n",
              "       'flaw', 'flick', 'focus', 'follow', 'following', 'footage',\n",
              "       'force', 'forced', 'forget', 'form', 'former', 'forward', 'found',\n",
              "       'four', 'free', 'french', 'friend', 'front', 'full', 'fun',\n",
              "       'funny', 'future', 'game', 'gave', 'gay', 'general', 'genre',\n",
              "       'george', 'german', 'get', 'getting', 'ghost', 'girl',\n",
              "       'girlfriend', 'give', 'given', 'giving', 'go', 'god', 'going',\n",
              "       'gone', 'good', 'gore', 'got', 'great', 'greatest', 'group',\n",
              "       'guess', 'gun', 'guy', 'hair', 'half', 'hand', 'happen',\n",
              "       'happened', 'happens', 'happy', 'hard', 'hardly', 'hate', 'head',\n",
              "       'hear', 'heard', 'heart', 'heavy', 'hell', 'help', 'hero', 'high',\n",
              "       'highly', 'hilarious', 'history', 'hit', 'hold', 'hole',\n",
              "       'hollywood', 'home', 'hope', 'horrible', 'horror', 'hot', 'hour',\n",
              "       'house', 'however', 'huge', 'human', 'humor', 'husband', 'idea',\n",
              "       'image', 'imagine', 'imdb', 'important', 'impressive', 'including',\n",
              "       'incredible', 'incredibly', 'indeed', 'indian', 'inside',\n",
              "       'instead', 'intelligent', 'interest', 'interested', 'interesting',\n",
              "       'involved', 'island', 'issue', 'italian', 'jack', 'james', 'jane',\n",
              "       'japanese', 'job', 'joe', 'john', 'joke', 'keep', 'kept', 'kid',\n",
              "       'kill', 'killed', 'killer', 'killing', 'kind', 'king', 'knew',\n",
              "       'know', 'known', 'la', 'lack', 'lady', 'lame', 'language', 'large',\n",
              "       'last', 'late', 'later', 'laugh', 'laughing', 'law', 'le', 'lead',\n",
              "       'leading', 'leaf', 'learn', 'least', 'leave', 'lee', 'left', 'let',\n",
              "       'level', 'life', 'light', 'like', 'liked', 'line', 'list',\n",
              "       'little', 'live', 'living', 'local', 'location', 'long', 'look',\n",
              "       'looked', 'looking', 'lost', 'lot', 'love', 'loved', 'lover',\n",
              "       'low', 'mad', 'made', 'main', 'major', 'make', 'maker', 'making',\n",
              "       'male', 'man', 'manages', 'many', 'mark', 'married', 'mary',\n",
              "       'master', 'masterpiece', 'match', 'material', 'matter', 'may',\n",
              "       'maybe', 'mean', 'meaning', 'meant', 'meet', 'member', 'memorable',\n",
              "       'memory', 'men', 'mention', 'mentioned', 'mess', 'message',\n",
              "       'michael', 'middle', 'might', 'million', 'mind', 'minute', 'miss',\n",
              "       'missed', 'missing', 'mistake', 'modern', 'moment', 'money',\n",
              "       'monster', 'mostly', 'mother', 'motion', 'move', 'movie', 'moving',\n",
              "       'mr', 'much', 'murder', 'music', 'musical', 'must', 'mystery',\n",
              "       'name', 'named', 'nature', 'near', 'nearly', 'need', 'needed',\n",
              "       'neither', 'never', 'new', 'next', 'nice', 'night', 'non', 'none',\n",
              "       'note', 'nothing', 'novel', 'nudity', 'number', 'obvious',\n",
              "       'obviously', 'odd', 'offer', 'office', 'often', 'oh', 'ok', 'okay',\n",
              "       'old', 'older', 'one', 'open', 'opening', 'opinion', 'order',\n",
              "       'original', 'oscar', 'others', 'otherwise', 'outside', 'overall',\n",
              "       'pace', 'parent', 'part', 'particular', 'particularly', 'party',\n",
              "       'past', 'paul', 'pay', 'people', 'perfect', 'perfectly',\n",
              "       'performance', 'perhaps', 'period', 'person', 'personal', 'peter',\n",
              "       'pick', 'picture', 'piece', 'place', 'plain', 'plan', 'planet',\n",
              "       'play', 'played', 'player', 'playing', 'please', 'plenty', 'plot',\n",
              "       'plus', 'point', 'pointless', 'police', 'political', 'poor',\n",
              "       'poorly', 'popular', 'portrayal', 'portrayed', 'positive',\n",
              "       'possible', 'possibly', 'post', 'potential', 'power', 'powerful',\n",
              "       'predictable', 'premise', 'present', 'pretty', 'previous',\n",
              "       'prison', 'probably', 'problem', 'produced', 'producer',\n",
              "       'production', 'project', 'public', 'pull', 'pure', 'purpose',\n",
              "       'put', 'quality', 'question', 'quickly', 'quite', 'rate', 'rated',\n",
              "       'rather', 'rating', 'read', 'reading', 'real', 'realistic',\n",
              "       'reality', 'realize', 'really', 'reason', 'recent', 'recently',\n",
              "       'recommend', 'red', 'relationship', 'release', 'released',\n",
              "       'remake', 'remember', 'rent', 'respect', 'rest', 'result',\n",
              "       'return', 'revenge', 'review', 'reviewer', 'rich', 'richard',\n",
              "       'ridiculous', 'right', 'robert', 'rock', 'role', 'romance',\n",
              "       'romantic', 'room', 'run', 'running', 'sad', 'sadly', 'said',\n",
              "       'save', 'saw', 'say', 'saying', 'scary', 'scene', 'school', 'sci',\n",
              "       'science', 'score', 'scott', 'screen', 'screenplay', 'script',\n",
              "       'season', 'second', 'secret', 'see', 'seeing', 'seem', 'seemed',\n",
              "       'seems', 'seen', 'self', 'sense', 'sequel', 'sequence', 'series',\n",
              "       'serious', 'seriously', 'set', 'setting', 'several', 'sex',\n",
              "       'sexual', 'shame', 'shoot', 'shooting', 'short', 'shot', 'show',\n",
              "       'showing', 'shown', 'side', 'silly', 'similar', 'simple', 'simply',\n",
              "       'since', 'singing', 'single', 'sister', 'sit', 'situation',\n",
              "       'slasher', 'slightly', 'slow', 'small', 'social', 'society',\n",
              "       'soldier', 'solid', 'somehow', 'someone', 'something', 'sometimes',\n",
              "       'somewhat', 'son', 'song', 'soon', 'sorry', 'sort', 'soul',\n",
              "       'sound', 'soundtrack', 'space', 'speak', 'special', 'spend',\n",
              "       'spent', 'spirit', 'spoiler', 'spot', 'stage', 'stand', 'standard',\n",
              "       'star', 'start', 'started', 'state', 'stay', 'step', 'stick',\n",
              "       'still', 'stop', 'store', 'story', 'storyline', 'straight',\n",
              "       'strange', 'street', 'strong', 'student', 'studio', 'stuff',\n",
              "       'stupid', 'style', 'subject', 'success', 'successful', 'suddenly',\n",
              "       'super', 'superb', 'supporting', 'supposed', 'sure', 'surprise',\n",
              "       'surprised', 'suspense', 'sweet', 'take', 'taken', 'taking',\n",
              "       'tale', 'talent', 'talented', 'talk', 'talking', 'taste', 'team',\n",
              "       'teen', 'television', 'tell', 'telling', 'ten', 'tension', 'term',\n",
              "       'terrible', 'th', 'theater', 'theme', 'thing', 'think', 'thinking',\n",
              "       'third', 'though', 'thought', 'three', 'thriller', 'throughout',\n",
              "       'throw', 'time', 'title', 'today', 'together', 'told', 'tom',\n",
              "       'tone', 'tony', 'took', 'top', 'total', 'totally', 'touch',\n",
              "       'towards', 'town', 'track', 'trash', 'tried', 'trip', 'trouble',\n",
              "       'true', 'truly', 'truth', 'try', 'trying', 'turn', 'turned', 'tv',\n",
              "       'twist', 'two', 'type', 'typical', 'ultimately', 'understand',\n",
              "       'unfortunately', 'unique', 'unless', 'unlike', 'upon', 'us', 'use',\n",
              "       'used', 'using', 'usual', 'usually', 'value', 'vampire', 'van',\n",
              "       'various', 'version', 'victim', 'video', 'view', 'viewer',\n",
              "       'viewing', 'villain', 'violence', 'violent', 'visual', 'voice',\n",
              "       'wait', 'waiting', 'walk', 'wall', 'want', 'wanted', 'war',\n",
              "       'waste', 'wasted', 'watch', 'watched', 'watching', 'water', 'way',\n",
              "       'weak', 'week', 'weird', 'well', 'went', 'western', 'whatever',\n",
              "       'whether', 'white', 'whole', 'whose', 'wife', 'william', 'win',\n",
              "       'wish', 'within', 'without', 'woman', 'wonder', 'wonderful',\n",
              "       'wood', 'word', 'work', 'worked', 'working', 'world', 'worse',\n",
              "       'worst', 'worth', 'would', 'write', 'writer', 'writing', 'written',\n",
              "       'wrong', 'wrote', 'year', 'yes', 'yet', 'york', 'young', 'younger',\n",
              "       'zombie'], dtype=object)"
            ]
          },
          "metadata": {},
          "execution_count": 105
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "# Simple Feed Forward Neural Network Model"
      ],
      "metadata": {
        "id": "I4UGaUfND678"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import torch\n",
        "import torch.nn as nn\n",
        "import torchmetrics\n",
        "from torch.utils.data import DataLoader, Dataset\n",
        "import torch.nn.functional as F\n",
        "import pytorch_lightning as pl\n",
        "\n",
        "class Net(pl.LightningModule):\n",
        "\n",
        "    def __init__(self):\n",
        "        super(Net, self).__init__()\n",
        "        self.criterion = torch.nn.BCELoss()\n",
        "        self.train_acc = torchmetrics.classification.Accuracy(task=\"multiclass\", num_classes=2)\n",
        "        self.valid_acc = torchmetrics.classification.Accuracy(task=\"multiclass\", num_classes=2)\n",
        "        self.fc1 = nn.Linear(1000, 120)  # input dimension with 2000 words/tokens\n",
        "        self.fc2 = nn.Linear(120, 84)\n",
        "        self.fc3 = nn.Linear(84, 2)\n",
        "\n",
        "    def forward(self, x):\n",
        "        x = F.relu(self.fc1(x))\n",
        "        x = F.relu(self.fc2(x))\n",
        "        x = F.sigmoid(self.fc3(x))\n",
        "        return x\n",
        "\n",
        "    def training_step(self, batch, batch_idx):\n",
        "        x, y = batch\n",
        "        logits = self.forward(x)\n",
        "        loss = self.criterion(logits, y)\n",
        "        accuracy = self.train_acc(logits.round(), y)\n",
        "        self.log('train_loss', loss)\n",
        "        self.log('train_acc', accuracy, on_epoch=True)\n",
        "        return loss\n",
        "\n",
        "    def validation_step(self, batch, batch_idx):\n",
        "        x, y = batch\n",
        "        logits = self.forward(x)\n",
        "        loss = self.criterion(logits, y)\n",
        "        accuracy = self.valid_acc(logits.round(), y)\n",
        "        self.log('val_loss', loss)\n",
        "        self.log('val_acc', accuracy, on_epoch=True)\n",
        "\n",
        "    def configure_optimizers(self):\n",
        "        opt = torch.optim.Adam(self.parameters(), lr=1e-3)\n",
        "        return opt\n",
        "\n",
        "net = Net()\n",
        "print(net)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "YrhqVdw6C7fw",
        "outputId": "1a53d934-e18f-4a7f-9b60-8ea463c8e940"
      },
      "execution_count": 113,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Net(\n",
            "  (criterion): BCELoss()\n",
            "  (train_acc): MulticlassAccuracy()\n",
            "  (valid_acc): MulticlassAccuracy()\n",
            "  (fc1): Linear(in_features=1000, out_features=120, bias=True)\n",
            "  (fc2): Linear(in_features=120, out_features=84, bias=True)\n",
            "  (fc3): Linear(in_features=84, out_features=2, bias=True)\n",
            ")\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_features_tensor = torch.from_numpy(train_features.todense().astype('float32'))\n",
        "train_labels_tensor = torch.from_numpy(train_label.todense().astype('float32'))"
      ],
      "metadata": {
        "id": "H9ucTV3BERIQ"
      },
      "execution_count": 107,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "test_features_tensor = torch.from_numpy(test_features.todense().astype('float32'))\n",
        "test_labels_tensor = torch.from_numpy(test_label.todense().astype('float32'))"
      ],
      "metadata": {
        "id": "xqvnQsoDJ9i0"
      },
      "execution_count": 108,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "class CustomDataset(Dataset):\n",
        "  def __init__(self, X, y):\n",
        "    self.X = X\n",
        "    self.y = y\n",
        "\n",
        "  def __getitem__(self, idx):\n",
        "    return self.X[idx], self.y[idx]\n",
        "\n",
        "  def __len__(self):\n",
        "    return len(self.X)\n",
        "\n",
        "train_dataset = CustomDataset(train_features_tensor, train_labels_tensor)\n",
        "train_dataloader = DataLoader(train_dataset, batch_size=128, shuffle=True)\n",
        "\n",
        "test_dataset = CustomDataset(test_features_tensor, test_labels_tensor)\n",
        "test_dataloader = DataLoader(test_dataset, batch_size=128, shuffle=True)"
      ],
      "metadata": {
        "id": "nrO7UUk0Irlz"
      },
      "execution_count": 109,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "trainer = pl.Trainer(max_epochs=5)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "1_Jv7k1TFlZ-",
        "outputId": "503f8e9c-dcbe-4104-e656-f5c6fd82cec1"
      },
      "execution_count": 114,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.utilities.rank_zero:GPU available: True (cuda), used: True\n",
            "INFO:pytorch_lightning.utilities.rank_zero:TPU available: False, using: 0 TPU cores\n",
            "INFO:pytorch_lightning.utilities.rank_zero:IPU available: False, using: 0 IPUs\n",
            "INFO:pytorch_lightning.utilities.rank_zero:HPU available: False, using: 0 HPUs\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.validate(net, test_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 205,
          "referenced_widgets": [
            "b6a6cacced554478abed754b32c8bdaf",
            "2f790bb14abf4135a5e8d5b667b7a053",
            "6d48947b0a184b4c8db624247e3eae13",
            "ff21ede6f3d440668e4a4b2f4c02a6ef",
            "b40f8c8354dd44aeb48987055f1c21ef",
            "d2083ab1595b4795a15233203ffe7155",
            "0b7de314ab6540b0a584ab601d008247",
            "87e6fc4c6a16477490ad94c47be89e2f",
            "f27d5212e2744980ab4c0f0d5b187dee",
            "3c00f52a6618438dbf7930e72aa56070",
            "e9fa822100b04fd9ae423f572ac0a3b6"
          ]
        },
        "id": "Hw2HCs85KKBd",
        "outputId": "5ae47ef3-ddde-4822-ef76-4003ea9fd839"
      },
      "execution_count": 115,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Validation: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "b6a6cacced554478abed754b32c8bdaf"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃\u001b[1m \u001b[0m\u001b[1m     Validate metric     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m      DataLoader 0       \u001b[0m\u001b[1m \u001b[0m┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│\u001b[36m \u001b[0m\u001b[36m         val_acc         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m           0.5           \u001b[0m\u001b[35m \u001b[0m│\n",
              "│\u001b[36m \u001b[0m\u001b[36m        val_loss         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.6937711834907532    \u001b[0m\u001b[35m \u001b[0m│\n",
              "└───────────────────────────┴───────────────────────────┘\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃<span style=\"font-weight: bold\">      Validate metric      </span>┃<span style=\"font-weight: bold\">       DataLoader 0        </span>┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">          val_acc          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">            0.5            </span>│\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">         val_loss          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.6937711834907532     </span>│\n",
              "└───────────────────────────┴───────────────────────────┘\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'val_loss': 0.6937711834907532, 'val_acc': 0.5}]"
            ]
          },
          "metadata": {},
          "execution_count": 115
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.fit(net, train_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 386,
          "referenced_widgets": [
            "5c92afb6951f4194824019c8042e07b0",
            "6add077d6545439dad0f9db1585b2504",
            "01cf010f15c44a408bb5ea1a317ea320",
            "5df6144974934233a219199c24229981",
            "9ed6f7ba59a248db932b18c9cfe2b07e",
            "5dbefe5091e7463e80fab6ea8222ea77",
            "9f6ee17ed6184906bd9c77a133c0ef3e",
            "04923785f16a42d29b0ad90829ff7ebc",
            "416731f1221848ceafbbb7c246c17184",
            "0a9020973d994f69948b5a0dcde0beb1",
            "27d4dcce297d4fbca49928112fe9ae48"
          ]
        },
        "id": "ANMMWPgqGgAk",
        "outputId": "642ead82-3d6a-42e9-978a-8c926689ded6"
      },
      "execution_count": 116,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/trainer/configuration_validator.py:74: You defined a `validation_step` but have no `val_dataloader`. Skipping val loop.\n",
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n",
            "INFO:pytorch_lightning.callbacks.model_summary:\n",
            "  | Name      | Type               | Params\n",
            "-------------------------------------------------\n",
            "0 | criterion | BCELoss            | 0     \n",
            "1 | train_acc | MulticlassAccuracy | 0     \n",
            "2 | valid_acc | MulticlassAccuracy | 0     \n",
            "3 | fc1       | Linear             | 120 K \n",
            "4 | fc2       | Linear             | 10.2 K\n",
            "5 | fc3       | Linear             | 170   \n",
            "-------------------------------------------------\n",
            "130 K     Trainable params\n",
            "0         Non-trainable params\n",
            "130 K     Total params\n",
            "0.522     Total estimated model params size (MB)\n",
            "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/trainer/connectors/data_connector.py:441: The 'train_dataloader' does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` to `num_workers=1` in the `DataLoader` to improve performance.\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Training: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "5c92afb6951f4194824019c8042e07b0"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.utilities.rank_zero:`Trainer.fit` stopped: `max_epochs=5` reached.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.validate(net, test_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 205,
          "referenced_widgets": [
            "27929af80e9743008c0e2a685d91a3a8",
            "0ea49ab37ab84affaff360242b68c279",
            "4691719986c446b5a146b1ee5279333f",
            "43980dd9c3fb4c8ab4a51aa9fa4590cd",
            "5e66f600314d426699d7b9e7ae6def7d",
            "a8a77ca4399f438999c24b85c8e8b8c9",
            "b1b8d580a7ca45de9d96f5b43afa2a5e",
            "ab70d6bd9acc4edc8210b8ab890cc984",
            "dcfac8234b2849c38da25a21efc16aff",
            "3f480166102a4d879b7a43b91715bb08",
            "605bc5f7472b4a46809f2a9863588776"
          ]
        },
        "id": "zGm26GEDHpOU",
        "outputId": "fe84a33b-1633-44d3-8479-fbedcdfcd8f7"
      },
      "execution_count": 117,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Validation: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "27929af80e9743008c0e2a685d91a3a8"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃\u001b[1m \u001b[0m\u001b[1m     Validate metric     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m      DataLoader 0       \u001b[0m\u001b[1m \u001b[0m┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│\u001b[36m \u001b[0m\u001b[36m         val_acc         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.8017399907112122    \u001b[0m\u001b[35m \u001b[0m│\n",
              "│\u001b[36m \u001b[0m\u001b[36m        val_loss         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.4267631471157074    \u001b[0m\u001b[35m \u001b[0m│\n",
              "└───────────────────────────┴───────────────────────────┘\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃<span style=\"font-weight: bold\">      Validate metric      </span>┃<span style=\"font-weight: bold\">       DataLoader 0        </span>┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">          val_acc          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.8017399907112122     </span>│\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">         val_loss          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.4267631471157074     </span>│\n",
              "└───────────────────────────┴───────────────────────────┘\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'val_loss': 0.4267631471157074, 'val_acc': 0.8017399907112122}]"
            ]
          },
          "metadata": {},
          "execution_count": 117
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Results:\n",
        "- Accuracy of 85.60%\n",
        "- Bag of Words Features"
      ],
      "metadata": {
        "id": "Fe2A9HWAxuVq"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "# LSTM Model"
      ],
      "metadata": {
        "id": "p8GHAf3dx5dz"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Preprocessing\n",
        "train = datasets.IMDB('./', split=\"train\")\n",
        "test = datasets.IMDB('./', split=\"test\")\n",
        "\n",
        "from collections import Counter\n",
        "\n",
        "train_data = []\n",
        "for label, text in train:\n",
        "  train_data.append((label, text))\n",
        "print(\"Label Counts for Train Data: \", Counter([_[0] for _ in train_data]))\n",
        "\n",
        "test_data = []\n",
        "for label, text in test:\n",
        "  test_data.append((label, text))\n",
        "print(\"Label Counts for Train Data: \", Counter([_[0] for _ in test_data]))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "l-cmTKSsx461",
        "outputId": "58cb25c6-d174-46e1-dfa8-5a3d0ef68715"
      },
      "execution_count": 57,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Label Counts for Train Data:  Counter({1: 12500, 2: 12500})\n",
            "Label Counts for Train Data:  Counter({1: 12500, 2: 12500})\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# We want to remove all html tags\n",
        "# Remove punctuation\n",
        "# remove all the stopwords\n",
        "# apply stemming on the words\n",
        "# apply lemmatization on the words\n",
        "\n",
        "import re\n",
        "import nltk\n",
        "import string\n",
        "from nltk.corpus import stopwords\n",
        "from nltk.stem.porter import PorterStemmer\n",
        "from nltk.stem import WordNetLemmatizer\n",
        "\n",
        "nltk.download('stopwords')\n",
        "nltk.download('wordnet')\n",
        "porter_stemmer = PorterStemmer()\n",
        "lemmatizer = WordNetLemmatizer()\n",
        "\n",
        "MAX_WORDS_PER_REVIEW = 500\n",
        "\n",
        "def remove_punctuation(text):\n",
        "    return \"\".join([i for i in text if i not in string.punctuation and i not in string.digits])\n",
        "\n",
        "def remove_html_tags(text):\n",
        "    clean = re.compile('<.*?>')\n",
        "    return re.sub(clean, '', text).lower().strip()\n",
        "\n",
        "def word_stemming(words):\n",
        "    if type(words) == str:\n",
        "      words = words.split()\n",
        "    return [porter_stemmer.stem(word) for word in words]\n",
        "\n",
        "def word_lemmatizer(words):\n",
        "    if type(words) == str:\n",
        "      words = words.split()\n",
        "    return [lemmatizer.lemmatize(word) for word in words]\n",
        "\n",
        "def padding(words):\n",
        "    if type(words) == str:\n",
        "      words = words.split()\n",
        "\n",
        "    if len(words) < MAX_WORDS_PER_REVIEW:\n",
        "      words.extend([\"<PAD>\"]*(MAX_WORDS_PER_REVIEW - len(words)))\n",
        "    return \" \".join(words[:MAX_WORDS_PER_REVIEW])\n",
        "\n",
        "def convert_to_paragraph(words):\n",
        "    return padding(words)"
      ],
      "metadata": {
        "id": "m0f1sIUIKE7S",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "9b4ffc50-2937-4e1f-aaf2-544270a9fc94"
      },
      "execution_count": 59,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "[nltk_data] Downloading package stopwords to /root/nltk_data...\n",
            "[nltk_data]   Package stopwords is already up-to-date!\n",
            "[nltk_data] Downloading package wordnet to /root/nltk_data...\n",
            "[nltk_data]   Package wordnet is already up-to-date!\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "TRAIN_DATA_SIZE = len(train_data)\n",
        "for i in tqdm(range(TRAIN_DATA_SIZE)):\n",
        "  label, text = train_data[i]\n",
        "  #processed_text = convert_to_paragraph(remove_html_tags(text))\n",
        "  processed_text = convert_to_paragraph(word_lemmatizer(remove_punctuation(remove_html_tags(text))))\n",
        "  train_data[i] = (label, processed_text)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "Q_c7UG1PyP0E",
        "outputId": "e8ab2bb4-4ed2-40c3-db21-b64fd8710b25"
      },
      "execution_count": 60,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "\n",
            "  0%|          | 0/25000 [00:00<?, ?it/s]\u001b[A\n",
            "  0%|          | 98/25000 [00:00<00:25, 975.07it/s]\u001b[A\n",
            "  1%|          | 212/25000 [00:00<00:23, 1071.32it/s]\u001b[A\n",
            "  1%|▏         | 320/25000 [00:00<00:23, 1071.60it/s]\u001b[A\n",
            "  2%|▏         | 428/25000 [00:00<00:23, 1052.55it/s]\u001b[A\n",
            "  2%|▏         | 534/25000 [00:00<00:26, 940.17it/s] \u001b[A\n",
            "  3%|▎         | 630/25000 [00:00<00:26, 930.46it/s]\u001b[A\n",
            "  3%|▎         | 725/25000 [00:00<00:26, 916.63it/s]\u001b[A\n",
            "  3%|▎         | 818/25000 [00:00<00:26, 904.59it/s]\u001b[A\n",
            "  4%|▎         | 927/25000 [00:00<00:25, 954.61it/s]\u001b[A\n",
            "  4%|▍         | 1032/25000 [00:01<00:24, 977.70it/s]\u001b[A\n",
            "  5%|▍         | 1152/25000 [00:01<00:22, 1040.88it/s]\u001b[A\n",
            "  5%|▌         | 1260/25000 [00:01<00:22, 1049.88it/s]\u001b[A\n",
            "  5%|▌         | 1370/25000 [00:01<00:22, 1064.12it/s]\u001b[A\n",
            "  6%|▌         | 1477/25000 [00:01<00:23, 988.11it/s] \u001b[A\n",
            "  6%|▋         | 1578/25000 [00:01<00:28, 822.95it/s]\u001b[A\n",
            "  7%|▋         | 1666/25000 [00:01<00:30, 752.83it/s]\u001b[A\n",
            "  7%|▋         | 1746/25000 [00:01<00:33, 694.93it/s]\u001b[A\n",
            "  7%|▋         | 1819/25000 [00:02<00:35, 658.71it/s]\u001b[A\n",
            "  8%|▊         | 1887/25000 [00:02<00:36, 637.61it/s]\u001b[A\n",
            "  8%|▊         | 1952/25000 [00:02<00:39, 583.52it/s]\u001b[A\n",
            "  8%|▊         | 2012/25000 [00:02<00:39, 583.95it/s]\u001b[A\n",
            "  8%|▊         | 2072/25000 [00:02<00:43, 524.15it/s]\u001b[A\n",
            "  9%|▊         | 2126/25000 [00:02<00:43, 524.12it/s]\u001b[A\n",
            "  9%|▊         | 2180/25000 [00:02<00:43, 527.15it/s]\u001b[A\n",
            "  9%|▉         | 2234/25000 [00:02<00:43, 526.90it/s]\u001b[A\n",
            "  9%|▉         | 2297/25000 [00:02<00:40, 554.70it/s]\u001b[A\n",
            "  9%|▉         | 2354/25000 [00:03<00:41, 551.12it/s]\u001b[A\n",
            " 10%|▉         | 2413/25000 [00:03<00:40, 559.19it/s]\u001b[A\n",
            " 10%|▉         | 2473/25000 [00:03<00:39, 570.77it/s]\u001b[A\n",
            " 10%|█         | 2534/25000 [00:03<00:38, 580.50it/s]\u001b[A\n",
            " 10%|█         | 2596/25000 [00:03<00:38, 589.57it/s]\u001b[A\n",
            " 11%|█         | 2659/25000 [00:03<00:37, 597.64it/s]\u001b[A\n",
            " 11%|█         | 2719/25000 [00:03<00:38, 584.15it/s]\u001b[A\n",
            " 11%|█         | 2778/25000 [00:03<00:40, 555.25it/s]\u001b[A\n",
            " 11%|█▏        | 2834/25000 [00:03<00:42, 520.55it/s]\u001b[A\n",
            " 12%|█▏        | 2894/25000 [00:04<00:40, 541.11it/s]\u001b[A\n",
            " 12%|█▏        | 2956/25000 [00:04<00:39, 559.84it/s]\u001b[A\n",
            " 12%|█▏        | 3013/25000 [00:04<00:40, 548.25it/s]\u001b[A\n",
            " 12%|█▏        | 3069/25000 [00:04<00:42, 512.11it/s]\u001b[A\n",
            " 13%|█▎        | 3131/25000 [00:04<00:40, 540.54it/s]\u001b[A\n",
            " 13%|█▎        | 3194/25000 [00:04<00:38, 564.95it/s]\u001b[A\n",
            " 13%|█▎        | 3255/25000 [00:04<00:37, 574.66it/s]\u001b[A\n",
            " 13%|█▎        | 3313/25000 [00:04<00:41, 526.54it/s]\u001b[A\n",
            " 13%|█▎        | 3367/25000 [00:04<00:40, 528.00it/s]\u001b[A\n",
            " 14%|█▎        | 3426/25000 [00:05<00:39, 543.88it/s]\u001b[A\n",
            " 14%|█▍        | 3484/25000 [00:05<00:38, 553.22it/s]\u001b[A\n",
            " 14%|█▍        | 3540/25000 [00:05<00:40, 533.89it/s]\u001b[A\n",
            " 14%|█▍        | 3604/25000 [00:05<00:38, 560.56it/s]\u001b[A\n",
            " 15%|█▍        | 3661/25000 [00:05<00:39, 542.63it/s]\u001b[A\n",
            " 15%|█▍        | 3716/25000 [00:05<00:39, 535.98it/s]\u001b[A\n",
            " 15%|█▌        | 3770/25000 [00:05<00:41, 512.81it/s]\u001b[A\n",
            " 15%|█▌        | 3834/25000 [00:05<00:38, 546.33it/s]\u001b[A\n",
            " 16%|█▌        | 3890/25000 [00:05<00:38, 544.94it/s]\u001b[A\n",
            " 16%|█▌        | 3957/25000 [00:05<00:36, 580.10it/s]\u001b[A\n",
            " 16%|█▌        | 4016/25000 [00:06<00:36, 575.30it/s]\u001b[A\n",
            " 16%|█▋        | 4077/25000 [00:06<00:35, 584.66it/s]\u001b[A\n",
            " 17%|█▋        | 4185/25000 [00:06<00:28, 728.81it/s]\u001b[A\n",
            " 17%|█▋        | 4300/25000 [00:06<00:24, 847.98it/s]\u001b[A\n",
            " 18%|█▊        | 4404/25000 [00:06<00:22, 904.63it/s]\u001b[A\n",
            " 18%|█▊        | 4501/25000 [00:06<00:22, 920.47it/s]\u001b[A\n",
            " 18%|█▊        | 4594/25000 [00:06<00:22, 894.98it/s]\u001b[A\n",
            " 19%|█▉        | 4691/25000 [00:06<00:22, 916.30it/s]\u001b[A\n",
            " 19%|█▉        | 4783/25000 [00:06<00:22, 911.59it/s]\u001b[A\n",
            " 20%|█▉        | 4878/25000 [00:07<00:21, 922.17it/s]\u001b[A\n",
            " 20%|█▉        | 4976/25000 [00:07<00:21, 938.18it/s]\u001b[A\n",
            " 20%|██        | 5095/25000 [00:07<00:19, 1012.24it/s]\u001b[A\n",
            " 21%|██        | 5220/25000 [00:07<00:18, 1081.91it/s]\u001b[A\n",
            " 21%|██▏       | 5329/25000 [00:07<00:23, 839.44it/s] \u001b[A\n",
            " 22%|██▏       | 5422/25000 [00:07<00:30, 649.50it/s]\u001b[A\n",
            " 22%|██▏       | 5499/25000 [00:07<00:35, 547.94it/s]\u001b[A\n",
            " 22%|██▏       | 5564/25000 [00:08<00:41, 473.75it/s]\u001b[A\n",
            " 22%|██▏       | 5619/25000 [00:08<00:45, 429.50it/s]\u001b[A\n",
            " 23%|██▎       | 5668/25000 [00:08<00:47, 407.00it/s]\u001b[A\n",
            " 23%|██▎       | 5712/25000 [00:08<00:49, 389.81it/s]\u001b[A\n",
            " 23%|██▎       | 5753/25000 [00:08<00:53, 362.66it/s]\u001b[A\n",
            " 23%|██▎       | 5800/25000 [00:08<00:49, 384.55it/s]\u001b[A\n",
            " 23%|██▎       | 5840/25000 [00:08<00:52, 361.67it/s]\u001b[A\n",
            " 24%|██▎       | 5878/25000 [00:09<00:59, 321.56it/s]\u001b[A\n",
            " 24%|██▎       | 5918/25000 [00:09<00:56, 338.44it/s]\u001b[A\n",
            " 24%|██▍       | 5963/25000 [00:09<00:52, 365.18it/s]\u001b[A\n",
            " 24%|██▍       | 6001/25000 [00:09<00:54, 348.31it/s]\u001b[A\n",
            " 24%|██▍       | 6038/25000 [00:09<00:53, 353.56it/s]\u001b[A\n",
            " 24%|██▍       | 6075/25000 [00:09<01:00, 313.16it/s]\u001b[A\n",
            " 24%|██▍       | 6108/25000 [00:09<01:01, 308.48it/s]\u001b[A\n",
            " 25%|██▍       | 6146/25000 [00:09<00:58, 323.47it/s]\u001b[A\n",
            " 25%|██▍       | 6180/25000 [00:10<00:58, 320.28it/s]\u001b[A\n",
            " 25%|██▍       | 6213/25000 [00:10<01:01, 307.21it/s]\u001b[A\n",
            " 25%|██▌       | 6268/25000 [00:10<00:50, 372.48it/s]\u001b[A\n",
            " 25%|██▌       | 6322/25000 [00:10<00:44, 417.10it/s]\u001b[A\n",
            " 26%|██▌       | 6386/25000 [00:10<00:38, 480.28it/s]\u001b[A\n",
            " 26%|██▌       | 6436/25000 [00:10<00:43, 431.28it/s]\u001b[A\n",
            " 26%|██▌       | 6481/25000 [00:10<00:50, 370.06it/s]\u001b[A\n",
            " 26%|██▌       | 6521/25000 [00:10<00:51, 362.33it/s]\u001b[A\n",
            " 26%|██▋       | 6570/25000 [00:10<00:47, 391.16it/s]\u001b[A\n",
            " 27%|██▋       | 6659/25000 [00:11<00:35, 521.66it/s]\u001b[A\n",
            " 27%|██▋       | 6766/25000 [00:11<00:27, 669.08it/s]\u001b[A\n",
            " 28%|██▊       | 6882/25000 [00:11<00:22, 803.45it/s]\u001b[A\n",
            " 28%|██▊       | 6981/25000 [00:11<00:21, 855.07it/s]\u001b[A\n",
            " 28%|██▊       | 7091/25000 [00:11<00:19, 923.61it/s]\u001b[A\n",
            " 29%|██▉       | 7201/25000 [00:11<00:18, 973.54it/s]\u001b[A\n",
            " 29%|██▉       | 7317/25000 [00:11<00:17, 1028.14it/s]\u001b[A\n",
            " 30%|██▉       | 7421/25000 [00:11<00:17, 981.97it/s] \u001b[A\n",
            " 30%|███       | 7521/25000 [00:11<00:18, 960.90it/s]\u001b[A\n",
            " 30%|███       | 7618/25000 [00:12<00:18, 933.71it/s]\u001b[A\n",
            " 31%|███       | 7715/25000 [00:12<00:18, 942.98it/s]\u001b[A\n",
            " 31%|███       | 7811/25000 [00:12<00:18, 947.81it/s]\u001b[A\n",
            " 32%|███▏      | 7907/25000 [00:12<00:18, 936.38it/s]\u001b[A\n",
            " 32%|███▏      | 8001/25000 [00:12<00:18, 907.26it/s]\u001b[A\n",
            " 32%|███▏      | 8093/25000 [00:12<00:18, 891.88it/s]\u001b[A\n",
            " 33%|███▎      | 8198/25000 [00:12<00:18, 932.59it/s]\u001b[A\n",
            " 33%|███▎      | 8301/25000 [00:12<00:17, 959.08it/s]\u001b[A\n",
            " 34%|███▎      | 8398/25000 [00:12<00:18, 914.88it/s]\u001b[A\n",
            " 34%|███▍      | 8497/25000 [00:12<00:17, 933.91it/s]\u001b[A\n",
            " 34%|███▍      | 8599/25000 [00:13<00:17, 953.67it/s]\u001b[A\n",
            " 35%|███▍      | 8707/25000 [00:13<00:16, 989.19it/s]\u001b[A\n",
            " 35%|███▌      | 8813/25000 [00:13<00:16, 1009.46it/s]\u001b[A\n",
            " 36%|███▌      | 8915/25000 [00:13<00:16, 1003.01it/s]\u001b[A\n",
            " 36%|███▌      | 9025/25000 [00:13<00:15, 1031.25it/s]\u001b[A\n",
            " 37%|███▋      | 9135/25000 [00:13<00:15, 1051.22it/s]\u001b[A\n",
            " 37%|███▋      | 9241/25000 [00:13<00:15, 1024.43it/s]\u001b[A\n",
            " 37%|███▋      | 9344/25000 [00:13<00:16, 976.82it/s] \u001b[A\n",
            " 38%|███▊      | 9443/25000 [00:13<00:16, 960.73it/s]\u001b[A\n",
            " 38%|███▊      | 9540/25000 [00:14<00:16, 931.09it/s]\u001b[A\n",
            " 39%|███▊      | 9635/25000 [00:14<00:16, 933.52it/s]\u001b[A\n",
            " 39%|███▉      | 9744/25000 [00:14<00:15, 977.53it/s]\u001b[A\n",
            " 39%|███▉      | 9848/25000 [00:14<00:15, 993.30it/s]\u001b[A\n",
            " 40%|███▉      | 9962/25000 [00:14<00:14, 1033.69it/s]\u001b[A\n",
            " 40%|████      | 10072/25000 [00:14<00:14, 1051.50it/s]\u001b[A\n",
            " 41%|████      | 10179/25000 [00:14<00:14, 1055.84it/s]\u001b[A\n",
            " 41%|████      | 10285/25000 [00:14<00:13, 1051.53it/s]\u001b[A\n",
            " 42%|████▏     | 10406/25000 [00:14<00:13, 1098.18it/s]\u001b[A\n",
            " 42%|████▏     | 10516/25000 [00:14<00:13, 1075.24it/s]\u001b[A\n",
            " 42%|████▏     | 10624/25000 [00:15<00:13, 1063.45it/s]\u001b[A\n",
            " 43%|████▎     | 10731/25000 [00:15<00:13, 1021.91it/s]\u001b[A\n",
            " 43%|████▎     | 10846/25000 [00:15<00:13, 1058.35it/s]\u001b[A\n",
            " 44%|████▍     | 10967/25000 [00:15<00:12, 1101.84it/s]\u001b[A\n",
            " 44%|████▍     | 11080/25000 [00:15<00:12, 1108.86it/s]\u001b[A\n",
            " 45%|████▍     | 11192/25000 [00:15<00:12, 1090.56it/s]\u001b[A\n",
            " 45%|████▌     | 11302/25000 [00:15<00:12, 1078.76it/s]\u001b[A\n",
            " 46%|████▌     | 11411/25000 [00:15<00:12, 1069.43it/s]\u001b[A\n",
            " 46%|████▌     | 11520/25000 [00:15<00:12, 1071.38it/s]\u001b[A\n",
            " 47%|████▋     | 11628/25000 [00:15<00:12, 1057.90it/s]\u001b[A\n",
            " 47%|████▋     | 11735/25000 [00:16<00:12, 1061.27it/s]\u001b[A\n",
            " 47%|████▋     | 11842/25000 [00:16<00:13, 948.20it/s] \u001b[A\n",
            " 48%|████▊     | 11940/25000 [00:16<00:16, 810.67it/s]\u001b[A\n",
            " 48%|████▊     | 12026/25000 [00:16<00:18, 712.59it/s]\u001b[A\n",
            " 48%|████▊     | 12102/25000 [00:16<00:20, 616.55it/s]\u001b[A\n",
            " 49%|████▊     | 12169/25000 [00:16<00:21, 597.31it/s]\u001b[A\n",
            " 49%|████▉     | 12232/25000 [00:16<00:22, 573.50it/s]\u001b[A\n",
            " 49%|████▉     | 12292/25000 [00:17<00:24, 527.51it/s]\u001b[A\n",
            " 49%|████▉     | 12349/25000 [00:17<00:23, 536.75it/s]\u001b[A\n",
            " 50%|████▉     | 12404/25000 [00:17<00:23, 533.28it/s]\u001b[A\n",
            " 50%|████▉     | 12461/25000 [00:17<00:23, 540.25it/s]\u001b[A\n",
            " 50%|█████     | 12522/25000 [00:17<00:22, 557.57it/s]\u001b[A\n",
            " 50%|█████     | 12584/25000 [00:17<00:21, 573.40it/s]\u001b[A\n",
            " 51%|█████     | 12648/25000 [00:17<00:20, 592.03it/s]\u001b[A\n",
            " 51%|█████     | 12708/25000 [00:17<00:21, 560.05it/s]\u001b[A\n",
            " 51%|█████     | 12765/25000 [00:17<00:22, 554.61it/s]\u001b[A\n",
            " 51%|█████▏    | 12828/25000 [00:18<00:21, 573.82it/s]\u001b[A\n",
            " 52%|█████▏    | 12889/25000 [00:18<00:20, 583.08it/s]\u001b[A\n",
            " 52%|█████▏    | 12961/25000 [00:18<00:19, 618.95it/s]\u001b[A\n",
            " 52%|█████▏    | 13024/25000 [00:18<00:19, 612.22it/s]\u001b[A\n",
            " 52%|█████▏    | 13086/25000 [00:18<00:21, 551.80it/s]\u001b[A\n",
            " 53%|█████▎    | 13143/25000 [00:18<00:22, 538.78it/s]\u001b[A\n",
            " 53%|█████▎    | 13206/25000 [00:18<00:21, 559.01it/s]\u001b[A\n",
            " 53%|█████▎    | 13263/25000 [00:18<00:21, 545.55it/s]\u001b[A\n",
            " 53%|█████▎    | 13319/25000 [00:18<00:22, 521.54it/s]\u001b[A\n",
            " 53%|█████▎    | 13372/25000 [00:19<00:23, 501.53it/s]\u001b[A\n",
            " 54%|█████▎    | 13427/25000 [00:19<00:22, 513.24it/s]\u001b[A\n",
            " 54%|█████▍    | 13479/25000 [00:19<00:23, 490.59it/s]\u001b[A\n",
            " 54%|█████▍    | 13529/25000 [00:19<00:24, 469.86it/s]\u001b[A\n",
            " 54%|█████▍    | 13578/25000 [00:19<00:24, 473.53it/s]\u001b[A\n",
            " 55%|█████▍    | 13646/25000 [00:19<00:21, 526.55it/s]\u001b[A\n",
            " 55%|█████▍    | 13707/25000 [00:19<00:20, 549.61it/s]\u001b[A\n",
            " 55%|█████▌    | 13763/25000 [00:19<00:20, 545.49it/s]\u001b[A\n",
            " 55%|█████▌    | 13818/25000 [00:19<00:20, 537.22it/s]\u001b[A\n",
            " 55%|█████▌    | 13872/25000 [00:20<00:20, 530.63it/s]\u001b[A\n",
            " 56%|█████▌    | 13926/25000 [00:20<00:21, 526.35it/s]\u001b[A\n",
            " 56%|█████▌    | 13979/25000 [00:20<00:23, 478.01it/s]\u001b[A\n",
            " 56%|█████▌    | 14030/25000 [00:20<00:22, 483.27it/s]\u001b[A\n",
            " 56%|█████▋    | 14092/25000 [00:20<00:20, 519.55it/s]\u001b[A\n",
            " 57%|█████▋    | 14150/25000 [00:20<00:20, 534.95it/s]\u001b[A\n",
            " 57%|█████▋    | 14205/25000 [00:20<00:21, 508.85it/s]\u001b[A\n",
            " 57%|█████▋    | 14274/25000 [00:20<00:19, 557.65it/s]\u001b[A\n",
            " 57%|█████▋    | 14333/25000 [00:20<00:18, 566.32it/s]\u001b[A\n",
            " 58%|█████▊    | 14401/25000 [00:20<00:17, 596.75it/s]\u001b[A\n",
            " 58%|█████▊    | 14493/25000 [00:21<00:15, 688.35it/s]\u001b[A\n",
            " 58%|█████▊    | 14602/25000 [00:21<00:12, 805.25it/s]\u001b[A\n",
            " 59%|█████▉    | 14710/25000 [00:21<00:11, 886.16it/s]\u001b[A\n",
            " 59%|█████▉    | 14813/25000 [00:21<00:10, 928.67it/s]\u001b[A\n",
            " 60%|█████▉    | 14925/25000 [00:21<00:10, 984.47it/s]\u001b[A\n",
            " 60%|██████    | 15024/25000 [00:21<00:10, 978.99it/s]\u001b[A\n",
            " 60%|██████    | 15123/25000 [00:21<00:10, 958.81it/s]\u001b[A\n",
            " 61%|██████    | 15232/25000 [00:21<00:09, 992.13it/s]\u001b[A\n",
            " 61%|██████▏   | 15332/25000 [00:21<00:09, 984.64it/s]\u001b[A\n",
            " 62%|██████▏   | 15433/25000 [00:22<00:09, 991.01it/s]\u001b[A\n",
            " 62%|██████▏   | 15533/25000 [00:22<00:09, 965.69it/s]\u001b[A\n",
            " 63%|██████▎   | 15648/25000 [00:22<00:09, 1017.43it/s]\u001b[A\n",
            " 63%|██████▎   | 15751/25000 [00:22<00:09, 1012.23it/s]\u001b[A\n",
            " 63%|██████▎   | 15858/25000 [00:22<00:08, 1028.66it/s]\u001b[A\n",
            " 64%|██████▍   | 15962/25000 [00:22<00:09, 988.19it/s] \u001b[A\n",
            " 64%|██████▍   | 16062/25000 [00:22<00:09, 978.80it/s]\u001b[A\n",
            " 65%|██████▍   | 16161/25000 [00:22<00:09, 927.84it/s]\u001b[A\n",
            " 65%|██████▌   | 16257/25000 [00:22<00:09, 935.18it/s]\u001b[A\n",
            " 66%|██████▌   | 16375/25000 [00:22<00:08, 1004.44it/s]\u001b[A\n",
            " 66%|██████▌   | 16488/25000 [00:23<00:08, 1038.05it/s]\u001b[A\n",
            " 66%|██████▋   | 16593/25000 [00:23<00:08, 967.11it/s] \u001b[A\n",
            " 67%|██████▋   | 16691/25000 [00:23<00:08, 969.64it/s]\u001b[A\n",
            " 67%|██████▋   | 16789/25000 [00:23<00:08, 959.07it/s]\u001b[A\n",
            " 68%|██████▊   | 16902/25000 [00:23<00:08, 1005.07it/s]\u001b[A\n",
            " 68%|██████▊   | 17004/25000 [00:23<00:08, 976.06it/s] \u001b[A\n",
            " 68%|██████▊   | 17122/25000 [00:23<00:07, 1034.10it/s]\u001b[A\n",
            " 69%|██████▉   | 17227/25000 [00:23<00:07, 1032.49it/s]\u001b[A\n",
            " 69%|██████▉   | 17331/25000 [00:23<00:07, 994.87it/s] \u001b[A\n",
            " 70%|██████▉   | 17432/25000 [00:24<00:07, 994.83it/s]\u001b[A\n",
            " 70%|███████   | 17532/25000 [00:24<00:07, 984.93it/s]\u001b[A\n",
            " 71%|███████   | 17652/25000 [00:24<00:07, 1045.61it/s]\u001b[A\n",
            " 71%|███████   | 17757/25000 [00:24<00:06, 1036.61it/s]\u001b[A\n",
            " 71%|███████▏  | 17861/25000 [00:24<00:06, 1026.49it/s]\u001b[A\n",
            " 72%|███████▏  | 17964/25000 [00:24<00:07, 997.34it/s] \u001b[A\n",
            " 72%|███████▏  | 18064/25000 [00:24<00:07, 970.29it/s]\u001b[A\n",
            " 73%|███████▎  | 18162/25000 [00:24<00:07, 935.91it/s]\u001b[A\n",
            " 73%|███████▎  | 18270/25000 [00:24<00:06, 975.09it/s]\u001b[A\n",
            " 74%|███████▎  | 18381/25000 [00:24<00:06, 1013.79it/s]\u001b[A\n",
            " 74%|███████▍  | 18491/25000 [00:25<00:06, 1037.23it/s]\u001b[A\n",
            " 74%|███████▍  | 18613/25000 [00:25<00:05, 1088.09it/s]\u001b[A\n",
            " 75%|███████▍  | 18723/25000 [00:25<00:06, 1025.18it/s]\u001b[A\n",
            " 75%|███████▌  | 18832/25000 [00:25<00:05, 1035.94it/s]\u001b[A\n",
            " 76%|███████▌  | 18955/25000 [00:25<00:05, 1085.70it/s]\u001b[A\n",
            " 76%|███████▋  | 19065/25000 [00:25<00:05, 1089.05it/s]\u001b[A\n",
            " 77%|███████▋  | 19175/25000 [00:25<00:05, 1054.44it/s]\u001b[A\n",
            " 77%|███████▋  | 19281/25000 [00:25<00:05, 962.05it/s] \u001b[A\n",
            " 78%|███████▊  | 19379/25000 [00:25<00:05, 946.00it/s]\u001b[A\n",
            " 78%|███████▊  | 19475/25000 [00:26<00:05, 936.53it/s]\u001b[A\n",
            " 78%|███████▊  | 19579/25000 [00:26<00:05, 964.85it/s]\u001b[A\n",
            " 79%|███████▊  | 19677/25000 [00:26<00:05, 910.88it/s]\u001b[A\n",
            " 79%|███████▉  | 19793/25000 [00:26<00:05, 975.75it/s]\u001b[A\n",
            " 80%|███████▉  | 19900/25000 [00:26<00:05, 996.86it/s]\u001b[A\n",
            " 80%|████████  | 20001/25000 [00:26<00:05, 952.86it/s]\u001b[A\n",
            " 80%|████████  | 20106/25000 [00:26<00:04, 979.79it/s]\u001b[A\n",
            " 81%|████████  | 20216/25000 [00:26<00:04, 1012.62it/s]\u001b[A\n",
            " 81%|████████▏ | 20318/25000 [00:26<00:04, 976.62it/s] \u001b[A\n",
            " 82%|████████▏ | 20417/25000 [00:27<00:04, 969.17it/s]\u001b[A\n",
            " 82%|████████▏ | 20515/25000 [00:27<00:04, 963.74it/s]\u001b[A\n",
            " 83%|████████▎ | 20627/25000 [00:27<00:04, 1002.78it/s]\u001b[A\n",
            " 83%|████████▎ | 20728/25000 [00:27<00:04, 972.43it/s] \u001b[A\n",
            " 83%|████████▎ | 20826/25000 [00:27<00:04, 952.68it/s]\u001b[A\n",
            " 84%|████████▍ | 20942/25000 [00:27<00:04, 1010.54it/s]\u001b[A\n",
            " 84%|████████▍ | 21063/25000 [00:27<00:03, 1068.15it/s]\u001b[A\n",
            " 85%|████████▍ | 21171/25000 [00:27<00:03, 1013.93it/s]\u001b[A\n",
            " 85%|████████▌ | 21277/25000 [00:27<00:03, 1025.86it/s]\u001b[A\n",
            " 86%|████████▌ | 21381/25000 [00:27<00:03, 1015.16it/s]\u001b[A\n",
            " 86%|████████▌ | 21483/25000 [00:28<00:03, 1010.30it/s]\u001b[A\n",
            " 86%|████████▋ | 21587/25000 [00:28<00:03, 1017.59it/s]\u001b[A\n",
            " 87%|████████▋ | 21689/25000 [00:28<00:03, 1003.18it/s]\u001b[A\n",
            " 87%|████████▋ | 21796/25000 [00:28<00:03, 1022.16it/s]\u001b[A\n",
            " 88%|████████▊ | 21899/25000 [00:28<00:03, 962.94it/s] \u001b[A\n",
            " 88%|████████▊ | 21997/25000 [00:28<00:03, 928.61it/s]\u001b[A\n",
            " 88%|████████▊ | 22098/25000 [00:28<00:03, 950.67it/s]\u001b[A\n",
            " 89%|████████▉ | 22205/25000 [00:28<00:02, 982.94it/s]\u001b[A\n",
            " 89%|████████▉ | 22315/25000 [00:28<00:02, 1016.59it/s]\u001b[A\n",
            " 90%|████████▉ | 22421/25000 [00:29<00:02, 1028.12it/s]\u001b[A\n",
            " 90%|█████████ | 22535/25000 [00:29<00:02, 1060.14it/s]\u001b[A\n",
            " 91%|█████████ | 22642/25000 [00:29<00:02, 1010.54it/s]\u001b[A\n",
            " 91%|█████████ | 22746/25000 [00:29<00:02, 1018.38it/s]\u001b[A\n",
            " 91%|█████████▏| 22849/25000 [00:29<00:02, 993.89it/s] \u001b[A\n",
            " 92%|█████████▏| 22949/25000 [00:29<00:02, 994.20it/s]\u001b[A\n",
            " 92%|█████████▏| 23052/25000 [00:29<00:01, 1003.82it/s]\u001b[A\n",
            " 93%|█████████▎| 23157/25000 [00:29<00:01, 1016.91it/s]\u001b[A\n",
            " 93%|█████████▎| 23268/25000 [00:29<00:01, 1041.76it/s]\u001b[A\n",
            " 94%|█████████▎| 23387/25000 [00:29<00:01, 1080.23it/s]\u001b[A\n",
            " 94%|█████████▍| 23496/25000 [00:30<00:01, 1070.93it/s]\u001b[A\n",
            " 94%|█████████▍| 23604/25000 [00:30<00:01, 978.62it/s] \u001b[A\n",
            " 95%|█████████▍| 23707/25000 [00:30<00:01, 992.53it/s]\u001b[A\n",
            " 95%|█████████▌| 23808/25000 [00:30<00:01, 951.90it/s]\u001b[A\n",
            " 96%|█████████▌| 23905/25000 [00:30<00:01, 909.07it/s]\u001b[A\n",
            " 96%|█████████▌| 24006/25000 [00:30<00:01, 931.35it/s]\u001b[A\n",
            " 96%|█████████▋| 24100/25000 [00:30<00:00, 918.79it/s]\u001b[A\n",
            " 97%|█████████▋| 24214/25000 [00:30<00:00, 980.35it/s]\u001b[A\n",
            " 97%|█████████▋| 24313/25000 [00:30<00:00, 958.48it/s]\u001b[A\n",
            " 98%|█████████▊| 24410/25000 [00:31<00:00, 874.04it/s]\u001b[A\n",
            " 98%|█████████▊| 24500/25000 [00:31<00:00, 738.06it/s]\u001b[A\n",
            " 98%|█████████▊| 24579/25000 [00:31<00:00, 663.55it/s]\u001b[A\n",
            " 99%|█████████▊| 24650/25000 [00:31<00:00, 626.71it/s]\u001b[A\n",
            " 99%|█████████▉| 24716/25000 [00:31<00:00, 608.93it/s]\u001b[A\n",
            " 99%|█████████▉| 24779/25000 [00:31<00:00, 524.72it/s]\u001b[A\n",
            " 99%|█████████▉| 24834/25000 [00:31<00:00, 503.43it/s]\u001b[A\n",
            "100%|█████████▉| 24886/25000 [00:32<00:00, 502.63it/s]\u001b[A\n",
            "100%|█████████▉| 24941/25000 [00:32<00:00, 514.26it/s]\u001b[A\n",
            "100%|██████████| 25000/25000 [00:32<00:00, 775.14it/s]\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "TEST_DATA_SIZE = len(test_data)\n",
        "for i in tqdm(range(TEST_DATA_SIZE)):\n",
        "  label, text = test_data[i]\n",
        "  #processed_text = convert_to_paragraph(remove_html_tags(text))\n",
        "  processed_text = convert_to_paragraph(word_lemmatizer(remove_punctuation(remove_html_tags(text))))\n",
        "  test_data[i] = (label, processed_text)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "gYE_g0iIyd2n",
        "outputId": "66186eea-e386-4dd7-f0a0-ee49c16b9372"
      },
      "execution_count": 61,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "\n",
            "  0%|          | 0/25000 [00:00<?, ?it/s]\u001b[A\n",
            "  0%|          | 57/25000 [00:00<00:45, 554.17it/s]\u001b[A\n",
            "  0%|          | 113/25000 [00:00<00:49, 502.28it/s]\u001b[A\n",
            "  1%|          | 164/25000 [00:00<00:51, 479.79it/s]\u001b[A\n",
            "  1%|          | 220/25000 [00:00<00:49, 502.85it/s]\u001b[A\n",
            "  1%|          | 271/25000 [00:00<00:49, 503.43it/s]\u001b[A\n",
            "  1%|▏         | 334/25000 [00:00<00:45, 539.98it/s]\u001b[A\n",
            "  2%|▏         | 389/25000 [00:00<00:48, 504.29it/s]\u001b[A\n",
            "  2%|▏         | 440/25000 [00:00<00:50, 482.25it/s]\u001b[A\n",
            "  2%|▏         | 490/25000 [00:00<00:50, 486.72it/s]\u001b[A\n",
            "  2%|▏         | 541/25000 [00:01<00:49, 492.90it/s]\u001b[A\n",
            "  2%|▏         | 595/25000 [00:01<00:48, 506.21it/s]\u001b[A\n",
            "  3%|▎         | 660/25000 [00:01<00:44, 545.79it/s]\u001b[A\n",
            "  3%|▎         | 715/25000 [00:01<00:45, 528.04it/s]\u001b[A\n",
            "  3%|▎         | 776/25000 [00:01<00:44, 549.55it/s]\u001b[A\n",
            "  3%|▎         | 832/25000 [00:01<00:46, 520.76it/s]\u001b[A\n",
            "  4%|▎         | 888/25000 [00:01<00:45, 531.13it/s]\u001b[A\n",
            "  4%|▍         | 943/25000 [00:01<00:45, 532.22it/s]\u001b[A\n",
            "  4%|▍         | 997/25000 [00:01<00:45, 528.74it/s]\u001b[A\n",
            "  4%|▍         | 1067/25000 [00:02<00:41, 574.23it/s]\u001b[A\n",
            "  4%|▍         | 1125/25000 [00:02<00:43, 544.39it/s]\u001b[A\n",
            "  5%|▍         | 1180/25000 [00:02<00:45, 528.77it/s]\u001b[A\n",
            "  5%|▍         | 1243/25000 [00:02<00:42, 556.15it/s]\u001b[A\n",
            "  5%|▌         | 1300/25000 [00:02<00:45, 519.17it/s]\u001b[A\n",
            "  5%|▌         | 1353/25000 [00:02<00:47, 495.24it/s]\u001b[A\n",
            "  6%|▌         | 1421/25000 [00:02<00:43, 543.23it/s]\u001b[A\n",
            "  6%|▌         | 1495/25000 [00:02<00:39, 593.88it/s]\u001b[A\n",
            "  6%|▌         | 1556/25000 [00:02<00:39, 588.02it/s]\u001b[A\n",
            "  6%|▋         | 1617/25000 [00:03<00:39, 587.55it/s]\u001b[A\n",
            "  7%|▋         | 1682/25000 [00:03<00:38, 602.40it/s]\u001b[A\n",
            "  7%|▋         | 1752/25000 [00:03<00:36, 628.93it/s]\u001b[A\n",
            "  7%|▋         | 1838/25000 [00:03<00:33, 694.70it/s]\u001b[A\n",
            "  8%|▊         | 1944/25000 [00:03<00:28, 799.24it/s]\u001b[A\n",
            "  8%|▊         | 2029/25000 [00:03<00:28, 812.65it/s]\u001b[A\n",
            "  9%|▊         | 2136/25000 [00:03<00:25, 886.33it/s]\u001b[A\n",
            "  9%|▉         | 2231/25000 [00:03<00:25, 903.78it/s]\u001b[A\n",
            "  9%|▉         | 2329/25000 [00:03<00:24, 924.18it/s]\u001b[A\n",
            " 10%|▉         | 2436/25000 [00:03<00:23, 967.09it/s]\u001b[A\n",
            " 10%|█         | 2533/25000 [00:04<00:23, 962.23it/s]\u001b[A\n",
            " 11%|█         | 2652/25000 [00:04<00:21, 1026.14it/s]\u001b[A\n",
            " 11%|█         | 2774/25000 [00:04<00:20, 1082.81it/s]\u001b[A\n",
            " 12%|█▏        | 2883/25000 [00:04<00:21, 1022.83it/s]\u001b[A\n",
            " 12%|█▏        | 2990/25000 [00:04<00:21, 1035.86it/s]\u001b[A\n",
            " 12%|█▏        | 3095/25000 [00:04<00:21, 1039.28it/s]\u001b[A\n",
            " 13%|█▎        | 3214/25000 [00:04<00:20, 1082.78it/s]\u001b[A\n",
            " 13%|█▎        | 3325/25000 [00:04<00:19, 1090.52it/s]\u001b[A\n",
            " 14%|█▎        | 3435/25000 [00:04<00:20, 1043.05it/s]\u001b[A\n",
            " 14%|█▍        | 3544/25000 [00:04<00:20, 1049.23it/s]\u001b[A\n",
            " 15%|█▍        | 3652/25000 [00:05<00:20, 1057.48it/s]\u001b[A\n",
            " 15%|█▌        | 3765/25000 [00:05<00:19, 1078.42it/s]\u001b[A\n",
            " 16%|█▌        | 3882/25000 [00:05<00:19, 1103.45it/s]\u001b[A\n",
            " 16%|█▌        | 3993/25000 [00:05<00:19, 1063.80it/s]\u001b[A\n",
            " 16%|█▋        | 4103/25000 [00:05<00:19, 1072.83it/s]\u001b[A\n",
            " 17%|█▋        | 4211/25000 [00:05<00:20, 1034.58it/s]\u001b[A\n",
            " 17%|█▋        | 4332/25000 [00:05<00:19, 1078.99it/s]\u001b[A\n",
            " 18%|█▊        | 4441/25000 [00:05<00:19, 1040.68it/s]\u001b[A\n",
            " 18%|█▊        | 4567/25000 [00:05<00:18, 1101.03it/s]\u001b[A\n",
            " 19%|█▊        | 4678/25000 [00:06<00:19, 1065.78it/s]\u001b[A\n",
            " 19%|█▉        | 4791/25000 [00:06<00:18, 1083.90it/s]\u001b[A\n",
            " 20%|█▉        | 4900/25000 [00:06<00:20, 995.09it/s] \u001b[A\n",
            " 20%|██        | 5002/25000 [00:06<00:20, 989.66it/s]\u001b[A\n",
            " 20%|██        | 5103/25000 [00:06<00:20, 988.11it/s]\u001b[A\n",
            " 21%|██        | 5204/25000 [00:06<00:19, 993.61it/s]\u001b[A\n",
            " 21%|██        | 5304/25000 [00:06<00:19, 992.90it/s]\u001b[A\n",
            " 22%|██▏       | 5413/25000 [00:06<00:19, 1019.33it/s]\u001b[A\n",
            " 22%|██▏       | 5522/25000 [00:06<00:18, 1038.85it/s]\u001b[A\n",
            " 23%|██▎       | 5627/25000 [00:06<00:19, 1018.32it/s]\u001b[A\n",
            " 23%|██▎       | 5730/25000 [00:07<00:19, 993.09it/s] \u001b[A\n",
            " 23%|██▎       | 5837/25000 [00:07<00:18, 1014.10it/s]\u001b[A\n",
            " 24%|██▍       | 5939/25000 [00:07<00:18, 1014.79it/s]\u001b[A\n",
            " 24%|██▍       | 6041/25000 [00:07<00:19, 984.65it/s] \u001b[A\n",
            " 25%|██▍       | 6141/25000 [00:07<00:19, 988.55it/s]\u001b[A\n",
            " 25%|██▍       | 6241/25000 [00:07<00:19, 967.78it/s]\u001b[A\n",
            " 25%|██▌       | 6344/25000 [00:07<00:18, 985.19it/s]\u001b[A\n",
            " 26%|██▌       | 6469/25000 [00:07<00:17, 1061.84it/s]\u001b[A\n",
            " 26%|██▋       | 6583/25000 [00:07<00:17, 1081.74it/s]\u001b[A\n",
            " 27%|██▋       | 6692/25000 [00:08<00:16, 1077.78it/s]\u001b[A\n",
            " 27%|██▋       | 6815/25000 [00:08<00:16, 1119.11it/s]\u001b[A\n",
            " 28%|██▊       | 6942/25000 [00:08<00:15, 1161.95it/s]\u001b[A\n",
            " 28%|██▊       | 7059/25000 [00:08<00:16, 1111.37it/s]\u001b[A\n",
            " 29%|██▊       | 7171/25000 [00:08<00:16, 1072.42it/s]\u001b[A\n",
            " 29%|██▉       | 7279/25000 [00:08<00:17, 1013.21it/s]\u001b[A\n",
            " 30%|██▉       | 7382/25000 [00:08<00:17, 997.68it/s] \u001b[A\n",
            " 30%|██▉       | 7483/25000 [00:08<00:17, 978.36it/s]\u001b[A\n",
            " 30%|███       | 7582/25000 [00:08<00:18, 947.48it/s]\u001b[A\n",
            " 31%|███       | 7678/25000 [00:09<00:18, 932.87it/s]\u001b[A\n",
            " 31%|███       | 7781/25000 [00:09<00:17, 957.47it/s]\u001b[A\n",
            " 32%|███▏      | 7885/25000 [00:09<00:17, 979.59it/s]\u001b[A\n",
            " 32%|███▏      | 8003/25000 [00:09<00:16, 1034.29it/s]\u001b[A\n",
            " 32%|███▏      | 8107/25000 [00:09<00:16, 1010.85it/s]\u001b[A\n",
            " 33%|███▎      | 8209/25000 [00:09<00:16, 992.94it/s] \u001b[A\n",
            " 33%|███▎      | 8309/25000 [00:09<00:17, 963.73it/s]\u001b[A\n",
            " 34%|███▎      | 8414/25000 [00:09<00:16, 986.08it/s]\u001b[A\n",
            " 34%|███▍      | 8513/25000 [00:09<00:17, 954.03it/s]\u001b[A\n",
            " 34%|███▍      | 8622/25000 [00:09<00:16, 991.12it/s]\u001b[A\n",
            " 35%|███▍      | 8722/25000 [00:10<00:16, 975.89it/s]\u001b[A\n",
            " 35%|███▌      | 8821/25000 [00:10<00:16, 978.93it/s]\u001b[A\n",
            " 36%|███▌      | 8920/25000 [00:10<00:16, 968.74it/s]\u001b[A\n",
            " 36%|███▌      | 9018/25000 [00:10<00:16, 967.45it/s]\u001b[A\n",
            " 37%|███▋      | 9129/25000 [00:10<00:15, 1007.37it/s]\u001b[A\n",
            " 37%|███▋      | 9230/25000 [00:10<00:15, 1003.83it/s]\u001b[A\n",
            " 37%|███▋      | 9331/25000 [00:10<00:16, 976.96it/s] \u001b[A\n",
            " 38%|███▊      | 9454/25000 [00:10<00:14, 1046.89it/s]\u001b[A\n",
            " 38%|███▊      | 9559/25000 [00:10<00:14, 1035.82it/s]\u001b[A\n",
            " 39%|███▊      | 9663/25000 [00:10<00:15, 1019.46it/s]\u001b[A\n",
            " 39%|███▉      | 9766/25000 [00:11<00:15, 1008.35it/s]\u001b[A\n",
            " 39%|███▉      | 9871/25000 [00:11<00:14, 1018.90it/s]\u001b[A\n",
            " 40%|███▉      | 9974/25000 [00:11<00:15, 986.40it/s] \u001b[A\n",
            " 40%|████      | 10084/25000 [00:11<00:14, 1017.48it/s]\u001b[A\n",
            " 41%|████      | 10187/25000 [00:11<00:14, 1003.25it/s]\u001b[A\n",
            " 41%|████      | 10288/25000 [00:11<00:14, 1005.01it/s]\u001b[A\n",
            " 42%|████▏     | 10389/25000 [00:11<00:14, 980.55it/s] \u001b[A\n",
            " 42%|████▏     | 10495/25000 [00:11<00:14, 1002.02it/s]\u001b[A\n",
            " 42%|████▏     | 10596/25000 [00:11<00:14, 983.79it/s] \u001b[A\n",
            " 43%|████▎     | 10695/25000 [00:12<00:14, 976.47it/s]\u001b[A\n",
            " 43%|████▎     | 10793/25000 [00:12<00:14, 976.33it/s]\u001b[A\n",
            " 44%|████▎     | 10900/25000 [00:12<00:14, 1000.47it/s]\u001b[A\n",
            " 44%|████▍     | 11002/25000 [00:12<00:13, 1003.42it/s]\u001b[A\n",
            " 44%|████▍     | 11103/25000 [00:12<00:14, 980.31it/s] \u001b[A\n",
            " 45%|████▍     | 11207/25000 [00:12<00:13, 994.15it/s]\u001b[A\n",
            " 45%|████▌     | 11307/25000 [00:12<00:14, 976.69it/s]\u001b[A\n",
            " 46%|████▌     | 11412/25000 [00:12<00:13, 997.84it/s]\u001b[A\n",
            " 46%|████▌     | 11521/25000 [00:12<00:13, 1023.45it/s]\u001b[A\n",
            " 46%|████▋     | 11624/25000 [00:12<00:13, 1009.88it/s]\u001b[A\n",
            " 47%|████▋     | 11726/25000 [00:13<00:13, 998.30it/s] \u001b[A\n",
            " 47%|████▋     | 11831/25000 [00:13<00:13, 1012.08it/s]\u001b[A\n",
            " 48%|████▊     | 11933/25000 [00:13<00:12, 1008.65it/s]\u001b[A\n",
            " 48%|████▊     | 12034/25000 [00:13<00:14, 878.31it/s] \u001b[A\n",
            " 48%|████▊     | 12125/25000 [00:13<00:16, 802.16it/s]\u001b[A\n",
            " 49%|████▉     | 12209/25000 [00:13<00:17, 751.88it/s]\u001b[A\n",
            " 49%|████▉     | 12287/25000 [00:13<00:17, 707.44it/s]\u001b[A\n",
            " 49%|████▉     | 12360/25000 [00:13<00:19, 644.75it/s]\u001b[A\n",
            " 50%|████▉     | 12427/25000 [00:14<00:19, 633.29it/s]\u001b[A\n",
            " 50%|████▉     | 12492/25000 [00:14<00:21, 586.67it/s]\u001b[A\n",
            " 50%|█████     | 12552/25000 [00:14<00:21, 575.54it/s]\u001b[A\n",
            " 50%|█████     | 12614/25000 [00:14<00:21, 586.82it/s]\u001b[A\n",
            " 51%|█████     | 12674/25000 [00:14<00:22, 546.19it/s]\u001b[A\n",
            " 51%|█████     | 12730/25000 [00:14<00:24, 502.50it/s]\u001b[A\n",
            " 51%|█████     | 12782/25000 [00:14<00:27, 450.72it/s]\u001b[A\n",
            " 51%|█████▏    | 12829/25000 [00:14<00:26, 453.39it/s]\u001b[A\n",
            " 52%|█████▏    | 12876/25000 [00:15<00:27, 448.42it/s]\u001b[A\n",
            " 52%|█████▏    | 12939/25000 [00:15<00:24, 494.89it/s]\u001b[A\n",
            " 52%|█████▏    | 13004/25000 [00:15<00:22, 537.39it/s]\u001b[A\n",
            " 52%|█████▏    | 13063/25000 [00:15<00:21, 551.40it/s]\u001b[A\n",
            " 53%|█████▎    | 13129/25000 [00:15<00:20, 578.14it/s]\u001b[A\n",
            " 53%|█████▎    | 13188/25000 [00:15<00:21, 551.43it/s]\u001b[A\n",
            " 53%|█████▎    | 13246/25000 [00:15<00:21, 554.28it/s]\u001b[A\n",
            " 53%|█████▎    | 13302/25000 [00:15<00:22, 527.57it/s]\u001b[A\n",
            " 53%|█████▎    | 13356/25000 [00:15<00:22, 522.14it/s]\u001b[A\n",
            " 54%|█████▎    | 13414/25000 [00:15<00:21, 537.73it/s]\u001b[A\n",
            " 54%|█████▍    | 13470/25000 [00:16<00:21, 543.73it/s]\u001b[A\n",
            " 54%|█████▍    | 13525/25000 [00:16<00:21, 533.77it/s]\u001b[A\n",
            " 54%|█████▍    | 13580/25000 [00:16<00:21, 537.40it/s]\u001b[A\n",
            " 55%|█████▍    | 13634/25000 [00:16<00:22, 514.93it/s]\u001b[A\n",
            " 55%|█████▍    | 13697/25000 [00:16<00:20, 544.91it/s]\u001b[A\n",
            " 55%|█████▌    | 13752/25000 [00:16<00:21, 521.30it/s]\u001b[A\n",
            " 55%|█████▌    | 13805/25000 [00:16<00:21, 520.03it/s]\u001b[A\n",
            " 55%|█████▌    | 13858/25000 [00:16<00:21, 509.73it/s]\u001b[A\n",
            " 56%|█████▌    | 13916/25000 [00:16<00:20, 528.98it/s]\u001b[A\n",
            " 56%|█████▌    | 13970/25000 [00:17<00:21, 508.39it/s]\u001b[A\n",
            " 56%|█████▌    | 14022/25000 [00:17<00:21, 504.05it/s]\u001b[A\n",
            " 56%|█████▋    | 14075/25000 [00:17<00:21, 509.41it/s]\u001b[A\n",
            " 57%|█████▋    | 14127/25000 [00:17<00:22, 481.74it/s]\u001b[A\n",
            " 57%|█████▋    | 14183/25000 [00:17<00:21, 501.45it/s]\u001b[A\n",
            " 57%|█████▋    | 14237/25000 [00:17<00:21, 511.42it/s]\u001b[A\n",
            " 57%|█████▋    | 14289/25000 [00:17<00:21, 503.50it/s]\u001b[A\n",
            " 57%|█████▋    | 14353/25000 [00:17<00:19, 541.52it/s]\u001b[A\n",
            " 58%|█████▊    | 14422/25000 [00:17<00:18, 584.37it/s]\u001b[A\n",
            " 58%|█████▊    | 14481/25000 [00:17<00:18, 576.47it/s]\u001b[A\n",
            " 58%|█████▊    | 14567/25000 [00:18<00:15, 656.69it/s]\u001b[A\n",
            " 59%|█████▊    | 14674/25000 [00:18<00:13, 775.64it/s]\u001b[A\n",
            " 59%|█████▉    | 14781/25000 [00:18<00:11, 857.20it/s]\u001b[A\n",
            " 60%|█████▉    | 14893/25000 [00:18<00:10, 934.34it/s]\u001b[A\n",
            " 60%|██████    | 15000/25000 [00:18<00:10, 970.46it/s]\u001b[A\n",
            " 60%|██████    | 15100/25000 [00:18<00:10, 978.89it/s]\u001b[A\n",
            " 61%|██████    | 15199/25000 [00:18<00:10, 978.50it/s]\u001b[A\n",
            " 61%|██████    | 15305/25000 [00:18<00:09, 1001.09it/s]\u001b[A\n",
            " 62%|██████▏   | 15406/25000 [00:18<00:10, 948.39it/s] \u001b[A\n",
            " 62%|██████▏   | 15508/25000 [00:19<00:09, 967.23it/s]\u001b[A\n",
            " 63%|██████▎   | 15628/25000 [00:19<00:09, 1033.71it/s]\u001b[A\n",
            " 63%|██████▎   | 15732/25000 [00:19<00:09, 993.78it/s] \u001b[A\n",
            " 63%|██████▎   | 15853/25000 [00:19<00:08, 1055.40it/s]\u001b[A\n",
            " 64%|██████▍   | 15963/25000 [00:19<00:08, 1060.71it/s]\u001b[A\n",
            " 64%|██████▍   | 16070/25000 [00:19<00:08, 1051.43it/s]\u001b[A\n",
            " 65%|██████▍   | 16197/25000 [00:19<00:07, 1114.36it/s]\u001b[A\n",
            " 65%|██████▌   | 16309/25000 [00:19<00:08, 1073.99it/s]\u001b[A\n",
            " 66%|██████▌   | 16417/25000 [00:19<00:08, 1058.49it/s]\u001b[A\n",
            " 66%|██████▌   | 16524/25000 [00:19<00:08, 998.50it/s] \u001b[A\n",
            " 66%|██████▋   | 16625/25000 [00:20<00:08, 991.96it/s]\u001b[A\n",
            " 67%|██████▋   | 16725/25000 [00:20<00:08, 981.88it/s]\u001b[A\n",
            " 67%|██████▋   | 16826/25000 [00:20<00:08, 984.38it/s]\u001b[A\n",
            " 68%|██████▊   | 16926/25000 [00:20<00:08, 988.07it/s]\u001b[A\n",
            " 68%|██████▊   | 17026/25000 [00:20<00:08, 983.11it/s]\u001b[A\n",
            " 69%|██████▊   | 17134/25000 [00:20<00:07, 1009.80it/s]\u001b[A\n",
            " 69%|██████▉   | 17236/25000 [00:20<00:07, 980.05it/s] \u001b[A\n",
            " 69%|██████▉   | 17339/25000 [00:20<00:07, 990.32it/s]\u001b[A\n",
            " 70%|██████▉   | 17448/25000 [00:20<00:07, 1017.90it/s]\u001b[A\n",
            " 70%|███████   | 17551/25000 [00:21<00:07, 967.96it/s] \u001b[A\n",
            " 71%|███████   | 17658/25000 [00:21<00:07, 995.35it/s]\u001b[A\n",
            " 71%|███████   | 17763/25000 [00:21<00:07, 1008.61it/s]\u001b[A\n",
            " 71%|███████▏  | 17865/25000 [00:21<00:07, 922.06it/s] \u001b[A\n",
            " 72%|███████▏  | 17973/25000 [00:21<00:07, 957.55it/s]\u001b[A\n",
            " 72%|███████▏  | 18076/25000 [00:21<00:07, 974.92it/s]\u001b[A\n",
            " 73%|███████▎  | 18193/25000 [00:21<00:06, 1030.08it/s]\u001b[A\n",
            " 73%|███████▎  | 18298/25000 [00:21<00:06, 978.36it/s] \u001b[A\n",
            " 74%|███████▎  | 18398/25000 [00:21<00:06, 980.43it/s]\u001b[A\n",
            " 74%|███████▍  | 18497/25000 [00:22<00:06, 962.02it/s]\u001b[A\n",
            " 74%|███████▍  | 18595/25000 [00:22<00:06, 963.36it/s]\u001b[A\n",
            " 75%|███████▍  | 18705/25000 [00:22<00:06, 1001.79it/s]\u001b[A\n",
            " 75%|███████▌  | 18828/25000 [00:22<00:05, 1067.20it/s]\u001b[A\n",
            " 76%|███████▌  | 18943/25000 [00:22<00:05, 1088.37it/s]\u001b[A\n",
            " 76%|███████▌  | 19053/25000 [00:22<00:05, 1027.82it/s]\u001b[A\n",
            " 77%|███████▋  | 19157/25000 [00:22<00:05, 1023.07it/s]\u001b[A\n",
            " 77%|███████▋  | 19260/25000 [00:22<00:05, 1000.95it/s]\u001b[A\n",
            " 77%|███████▋  | 19367/25000 [00:22<00:05, 1019.32it/s]\u001b[A\n",
            " 78%|███████▊  | 19477/25000 [00:22<00:05, 1042.09it/s]\u001b[A\n",
            " 78%|███████▊  | 19582/25000 [00:23<00:05, 1024.50it/s]\u001b[A\n",
            " 79%|███████▉  | 19691/25000 [00:23<00:05, 1041.17it/s]\u001b[A\n",
            " 79%|███████▉  | 19825/25000 [00:23<00:04, 1125.98it/s]\u001b[A\n",
            " 80%|███████▉  | 19943/25000 [00:23<00:04, 1140.58it/s]\u001b[A\n",
            " 80%|████████  | 20058/25000 [00:23<00:04, 1108.62it/s]\u001b[A\n",
            " 81%|████████  | 20179/25000 [00:23<00:04, 1131.48it/s]\u001b[A\n",
            " 81%|████████  | 20293/25000 [00:23<00:04, 1070.73it/s]\u001b[A\n",
            " 82%|████████▏ | 20401/25000 [00:23<00:04, 1038.05it/s]\u001b[A\n",
            " 82%|████████▏ | 20506/25000 [00:23<00:04, 1015.51it/s]\u001b[A\n",
            " 82%|████████▏ | 20608/25000 [00:24<00:04, 988.37it/s] \u001b[A\n",
            " 83%|████████▎ | 20731/25000 [00:24<00:04, 1053.14it/s]\u001b[A\n",
            " 83%|████████▎ | 20840/25000 [00:24<00:03, 1063.50it/s]\u001b[A\n",
            " 84%|████████▍ | 20947/25000 [00:24<00:03, 1055.35it/s]\u001b[A\n",
            " 84%|████████▍ | 21053/25000 [00:24<00:04, 985.19it/s] \u001b[A\n",
            " 85%|████████▍ | 21153/25000 [00:24<00:04, 916.69it/s]\u001b[A\n",
            " 85%|████████▌ | 21259/25000 [00:24<00:03, 952.14it/s]\u001b[A\n",
            " 86%|████████▌ | 21379/25000 [00:24<00:03, 1020.57it/s]\u001b[A\n",
            " 86%|████████▌ | 21483/25000 [00:24<00:03, 993.69it/s] \u001b[A\n",
            " 86%|████████▋ | 21586/25000 [00:24<00:03, 1000.07it/s]\u001b[A\n",
            " 87%|████████▋ | 21687/25000 [00:25<00:03, 971.57it/s] \u001b[A\n",
            " 87%|████████▋ | 21807/25000 [00:25<00:03, 1036.37it/s]\u001b[A\n",
            " 88%|████████▊ | 21912/25000 [00:25<00:02, 1031.51it/s]\u001b[A\n",
            " 88%|████████▊ | 22016/25000 [00:25<00:03, 981.81it/s] \u001b[A\n",
            " 88%|████████▊ | 22115/25000 [00:25<00:02, 980.51it/s]\u001b[A\n",
            " 89%|████████▉ | 22231/25000 [00:25<00:02, 1030.62it/s]\u001b[A\n",
            " 89%|████████▉ | 22341/25000 [00:25<00:02, 1048.23it/s]\u001b[A\n",
            " 90%|████████▉ | 22447/25000 [00:25<00:02, 960.90it/s] \u001b[A\n",
            " 90%|█████████ | 22547/25000 [00:25<00:02, 968.27it/s]\u001b[A\n",
            " 91%|█████████ | 22646/25000 [00:26<00:02, 924.82it/s]\u001b[A\n",
            " 91%|█████████ | 22746/25000 [00:26<00:02, 944.30it/s]\u001b[A\n",
            " 91%|█████████▏| 22861/25000 [00:26<00:02, 1001.94it/s]\u001b[A\n",
            " 92%|█████████▏| 22963/25000 [00:26<00:02, 991.81it/s] \u001b[A\n",
            " 92%|█████████▏| 23068/25000 [00:26<00:01, 1008.12it/s]\u001b[A\n",
            " 93%|█████████▎| 23176/25000 [00:26<00:01, 1027.62it/s]\u001b[A\n",
            " 93%|█████████▎| 23280/25000 [00:26<00:01, 1029.39it/s]\u001b[A\n",
            " 94%|█████████▎| 23384/25000 [00:26<00:01, 997.41it/s] \u001b[A\n",
            " 94%|█████████▍| 23488/25000 [00:26<00:01, 1009.49it/s]\u001b[A\n",
            " 94%|█████████▍| 23592/25000 [00:26<00:01, 1010.99it/s]\u001b[A\n",
            " 95%|█████████▍| 23694/25000 [00:27<00:01, 1008.81it/s]\u001b[A\n",
            " 95%|█████████▌| 23801/25000 [00:27<00:01, 1018.38it/s]\u001b[A\n",
            " 96%|█████████▌| 23909/25000 [00:27<00:01, 1035.67it/s]\u001b[A\n",
            " 96%|█████████▌| 24014/25000 [00:27<00:00, 1037.91it/s]\u001b[A\n",
            " 96%|█████████▋| 24118/25000 [00:27<00:00, 956.04it/s] \u001b[A\n",
            " 97%|█████████▋| 24233/25000 [00:27<00:00, 1005.27it/s]\u001b[A\n",
            " 97%|█████████▋| 24349/25000 [00:27<00:00, 1045.58it/s]\u001b[A\n",
            " 98%|█████████▊| 24464/25000 [00:27<00:00, 1074.67it/s]\u001b[A\n",
            " 98%|█████████▊| 24575/25000 [00:27<00:00, 1079.58it/s]\u001b[A\n",
            " 99%|█████████▉| 24689/25000 [00:28<00:00, 1090.14it/s]\u001b[A\n",
            " 99%|█████████▉| 24799/25000 [00:28<00:00, 852.43it/s] \u001b[A\n",
            "100%|█████████▉| 24893/25000 [00:28<00:00, 693.88it/s]\u001b[A\n",
            "100%|██████████| 25000/25000 [00:28<00:00, 872.49it/s]\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "train_data[-100]"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "it43wVq91bnN",
        "outputId": "7aa4a0f4-bd98-4895-ca17-14734f4dda62"
      },
      "execution_count": 62,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(2,\n",
              " 'i cant remember many film where a bumbling idiot of a hero wa so funny throughout leslie cheung is such the antithesis of a hero that he too dense to be seduced by a gorgeous vampire i had the good luck to see it on a big screen and to find a video to watch again and again <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD> <PAD>')"
            ]
          },
          "metadata": {},
          "execution_count": 62
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "from torchtext.data import get_tokenizer\n",
        "from torchtext.vocab import build_vocab_from_iterator"
      ],
      "metadata": {
        "id": "yMkQMGB7yigG"
      },
      "execution_count": 63,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "tokenizer = get_tokenizer(\"basic_english\")\n",
        "\n",
        "def build_vocab(ds):\n",
        "  for _, text in ds:\n",
        "    yield tokenizer(text)\n",
        "\n",
        "vocab = build_vocab_from_iterator(build_vocab(train_data + test_data), min_freq=1, specials=['<UNK>'])\n",
        "vocab.set_default_index(vocab[\"<UNK>\"])"
      ],
      "metadata": {
        "id": "OF6s7Y4gzaWl"
      },
      "execution_count": 64,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "tokens = tokenizer(train_data[-100][1])\n",
        "indexes = vocab(tokens)\n",
        "\n",
        "print(tokens)\n",
        "print(indexes)\n",
        "print(len(tokens), len(indexes))"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "dP3wVyuRzj_W",
        "outputId": "0bbe64a8-daa2-46ad-e92e-fce3cceba160"
      },
      "execution_count": 65,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "['i', 'cant', 'remember', 'many', 'film', 'where', 'a', 'bumbling', 'idiot', 'of', 'a', 'hero', 'wa', 'so', 'funny', 'throughout', 'leslie', 'cheung', 'is', 'such', 'the', 'antithesis', 'of', 'a', 'hero', 'that', 'he', 'too', 'dense', 'to', 'be', 'seduced', 'by', 'a', 'gorgeous', 'vampire', 'i', 'had', 'the', 'good', 'luck', 'to', 'see', 'it', 'on', 'a', 'big', 'screen', 'and', 'to', 'find', 'a', 'video', 'to', 'watch', 'again', 'and', 'again', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>', '<pad>']\n",
            "[10, 176, 372, 108, 15, 121, 3, 4275, 1587, 5, 3, 484, 14, 36, 159, 476, 2956, 8122, 7, 140, 2, 14514, 5, 3, 484, 12, 23, 100, 9883, 6, 27, 8901, 30, 3, 1468, 817, 10, 68, 2, 48, 2012, 6, 60, 8, 19, 3, 196, 288, 4, 6, 137, 3, 359, 6, 105, 178, 4, 178, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n",
            "500 500\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "\n",
        "def make_label(label):\n",
        "  if label == 1:\n",
        "    return [1.0, 0.0]\n",
        "  return [0.0, 1.0]\n",
        "\n",
        "train_data_features = torch.LongTensor([vocab(tokenizer(i[1]))[::-1] for i in train_data])\n",
        "train_data_labels = torch.Tensor([make_label(i[0]) for i in train_data])\n",
        "\n",
        "test_data_features = torch.LongTensor([vocab(tokenizer(i[1]))[::-1] for i in test_data])\n",
        "test_data_labels = torch.Tensor([make_label(i[0]) for i in test_data])"
      ],
      "metadata": {
        "id": "EQfl9aFXzm9V"
      },
      "execution_count": 66,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "train_data_features.shape, train_data_labels.shape"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "L139TXw05kgf",
        "outputId": "7a1b2fcc-24bc-4532-e692-41a3bdc434f8"
      },
      "execution_count": 67,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(torch.Size([25000, 500]), torch.Size([25000, 2]))"
            ]
          },
          "metadata": {},
          "execution_count": 67
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "test_data_features.shape, test_data_labels.shape"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "tfw7KW367ggo",
        "outputId": "633a9cd3-b117-481a-9ce1-4199cfe2d700"
      },
      "execution_count": 68,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(torch.Size([25000, 500]), torch.Size([25000, 2]))"
            ]
          },
          "metadata": {},
          "execution_count": 68
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import torch\n",
        "import torch.nn as nn\n",
        "import torchmetrics\n",
        "from torch.utils.data import DataLoader, Dataset\n",
        "import torch.nn.functional as F\n",
        "import pytorch_lightning as pl\n",
        "\n",
        "EMBED_LEN = 32\n",
        "HIDDEN_DIM = 64\n",
        "NUM_LAYERS = 1\n",
        "\n",
        "class LSTMNet(pl.LightningModule):\n",
        "\n",
        "    def __init__(self, num_target_classes):\n",
        "        super(LSTMNet, self).__init__()\n",
        "        self.criterion = torch.nn.CrossEntropyLoss()\n",
        "        self.train_acc = torchmetrics.classification.Accuracy(task=\"multiclass\", num_classes=2)\n",
        "        self.valid_acc = torchmetrics.classification.Accuracy(task=\"multiclass\", num_classes=2)\n",
        "        self.embedding_layer = nn.Embedding(num_embeddings=len(vocab), embedding_dim=EMBED_LEN)\n",
        "        self.lstm = nn.LSTM(input_size=EMBED_LEN, hidden_size=HIDDEN_DIM, num_layers=NUM_LAYERS, batch_first=True)\n",
        "        self.linear1 = nn.Linear(HIDDEN_DIM, HIDDEN_DIM//2)\n",
        "        self.linear2 = nn.Linear(HIDDEN_DIM//2, num_target_classes)\n",
        "\n",
        "    def forward(self, X_batch):\n",
        "        embeddings = self.embedding_layer(X_batch)\n",
        "        # hidden, carry = torch.randn(NUM_LAYERS, len(X_batch), HIDDEN_DIM), torch.randn(NUM_LAYERS, len(X_batch), HIDDEN_DIM)\n",
        "        output, (hidden, carry) = self.lstm(embeddings) #, (hidden, carry))\n",
        "        x = F.relu(self.linear1(hidden[-1,:,:])) # output[:,-1]\n",
        "        return F.sigmoid(self.linear2(x))\n",
        "\n",
        "    def training_step(self, batch, batch_idx):\n",
        "        x, y = batch\n",
        "        logits = self.forward(x)\n",
        "        loss = self.criterion(logits, y)\n",
        "        accuracy = self.train_acc(logits.round(), y)\n",
        "        self.log('train_loss', loss, on_step=False, on_epoch=True, prog_bar=True)\n",
        "        self.log('train_acc', accuracy, on_epoch=True)\n",
        "        return loss\n",
        "\n",
        "    def validation_step(self, batch, batch_idx):\n",
        "        x, y = batch\n",
        "        logits = self.forward(x)\n",
        "        loss = self.criterion(logits, y)\n",
        "        accuracy = self.valid_acc(logits.round(), y)\n",
        "        self.log('val_loss', loss, on_step=False, on_epoch=True, prog_bar=True)\n",
        "        self.log('val_acc', accuracy, on_epoch=True)\n",
        "\n",
        "    def configure_optimizers(self):\n",
        "        opt = torch.optim.Adam(self.parameters(), lr=1e-3)\n",
        "        return opt\n",
        "\n",
        "lstm = LSTMNet(2)\n",
        "print(lstm)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "1p8nvUamAtLT",
        "outputId": "574d60de-f98a-47b6-c534-ca50a21a2bd7"
      },
      "execution_count": 75,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "LSTMNet(\n",
            "  (criterion): CrossEntropyLoss()\n",
            "  (train_acc): MulticlassAccuracy()\n",
            "  (valid_acc): MulticlassAccuracy()\n",
            "  (embedding_layer): Embedding(196750, 32)\n",
            "  (lstm): LSTM(32, 64, batch_first=True)\n",
            "  (linear1): Linear(in_features=64, out_features=32, bias=True)\n",
            "  (linear2): Linear(in_features=32, out_features=2, bias=True)\n",
            ")\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "class CustomDataset(Dataset):\n",
        "  def __init__(self, X, y):\n",
        "    self.X = X\n",
        "    self.y = y\n",
        "\n",
        "  def __getitem__(self, idx):\n",
        "    return self.X[idx], self.y[idx]\n",
        "\n",
        "  def __len__(self):\n",
        "    return len(self.X)\n",
        "\n",
        "train_dataset = CustomDataset(train_data_features, train_data_labels)\n",
        "train_dataloader = DataLoader(train_dataset, batch_size=128, shuffle=True)\n",
        "\n",
        "test_dataset = CustomDataset(test_data_features, test_data_labels)\n",
        "test_dataloader = DataLoader(test_dataset, batch_size=128, shuffle=True)"
      ],
      "metadata": {
        "id": "Z9IB8OnBBXhu"
      },
      "execution_count": 76,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "trainer = pl.Trainer(max_epochs=25, accelerator=\"gpu\", devices=[0])"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "xXDnKvaABnsR",
        "outputId": "d5cd4dd5-cd15-473e-f2b0-68282d103668"
      },
      "execution_count": 85,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.utilities.rank_zero:GPU available: True (cuda), used: True\n",
            "INFO:pytorch_lightning.utilities.rank_zero:TPU available: False, using: 0 TPU cores\n",
            "INFO:pytorch_lightning.utilities.rank_zero:IPU available: False, using: 0 IPUs\n",
            "INFO:pytorch_lightning.utilities.rank_zero:HPU available: False, using: 0 HPUs\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.validate(lstm, test_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 240,
          "referenced_widgets": [
            "afa89fcbd202483da2639103829f1a17",
            "07806541decf40c6a563acb1fab92131",
            "f0294e73fc2b4378b72e4d9927e99ac3",
            "45570dc2aada4285bc9a6f9bd577fcfd",
            "3aaadacc8a1c43d6a5f634669e3fe8fb",
            "545a7a7b169749638f11b041743087d1",
            "b883c76ddbf74edeb10c3fc442271eb9",
            "d5e734b74b6b4420b57048c469f125c0",
            "a4b16a6948b645538d45d1f6a0a42cf4",
            "27ed3a78e167420dbfec61bcf6ec5de5",
            "e26aeae539284c9e99af2048c5e57f63"
          ]
        },
        "id": "-OpoRUo6ByrY",
        "outputId": "8249d36f-39e9-46c8-ea06-6ef5ffaac96a"
      },
      "execution_count": 78,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n",
            "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/trainer/connectors/data_connector.py:492: Your `val_dataloader`'s sampler has shuffling enabled, it is strongly recommended that you turn shuffling off for val/test dataloaders.\n",
            "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/trainer/connectors/data_connector.py:441: The 'val_dataloader' does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` to `num_workers=1` in the `DataLoader` to improve performance.\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Validation: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "afa89fcbd202483da2639103829f1a17"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃\u001b[1m \u001b[0m\u001b[1m     Validate metric     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m      DataLoader 0       \u001b[0m\u001b[1m \u001b[0m┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│\u001b[36m \u001b[0m\u001b[36m         val_acc         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m           0.5           \u001b[0m\u001b[35m \u001b[0m│\n",
              "│\u001b[36m \u001b[0m\u001b[36m        val_loss         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.6932412385940552    \u001b[0m\u001b[35m \u001b[0m│\n",
              "└───────────────────────────┴───────────────────────────┘\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃<span style=\"font-weight: bold\">      Validate metric      </span>┃<span style=\"font-weight: bold\">       DataLoader 0        </span>┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">          val_acc          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">            0.5            </span>│\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">         val_loss          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.6932412385940552     </span>│\n",
              "└───────────────────────────┴───────────────────────────┘\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'val_loss': 0.6932412385940552, 'val_acc': 0.5}]"
            ]
          },
          "metadata": {},
          "execution_count": 78
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.fit(lstm, train_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 368,
          "referenced_widgets": [
            "e9af983a251a4c0ab76ef2cb4a8c0e53",
            "6448add48dd04f24b7556ae9e85c4df4",
            "0dd7838d5d974dd59b5128d975723dc0",
            "ed9271e198b54c57a2fe837ada880268",
            "1b7e150e0e464c33aa8f64fcf22dfb6a",
            "2d35b60ea18e44209f905b92c35abcbe",
            "55eab8b693f944f8a9e013e9f06a6a1a",
            "762fcf3b646b4dd7b27bb35937a048d0",
            "858ecde6e4704dbfa37adb533f65d22f",
            "e6220dcbec4b43e1ac085d5f20991e0a",
            "9bfdaf659d0340aeb0e000f8536d29fd"
          ]
        },
        "id": "khRwQZBuB3da",
        "outputId": "2b0351ee-02c2-428f-d10c-53b938e0e803"
      },
      "execution_count": 86,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n",
            "INFO:pytorch_lightning.callbacks.model_summary:\n",
            "  | Name            | Type               | Params\n",
            "-------------------------------------------------------\n",
            "0 | criterion       | CrossEntropyLoss   | 0     \n",
            "1 | train_acc       | MulticlassAccuracy | 0     \n",
            "2 | valid_acc       | MulticlassAccuracy | 0     \n",
            "3 | embedding_layer | Embedding          | 6.3 M \n",
            "4 | lstm            | LSTM               | 25.1 K\n",
            "5 | linear1         | Linear             | 2.1 K \n",
            "6 | linear2         | Linear             | 66    \n",
            "-------------------------------------------------------\n",
            "6.3 M     Trainable params\n",
            "0         Non-trainable params\n",
            "6.3 M     Total params\n",
            "25.293    Total estimated model params size (MB)\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Training: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "e9af983a251a4c0ab76ef2cb4a8c0e53"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.utilities.rank_zero:`Trainer.fit` stopped: `max_epochs=25` reached.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "trainer.validate(lstm, test_dataloader)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 205,
          "referenced_widgets": [
            "c84c2227538e4f2686200d593cf20be4",
            "243b9ac67e5140a795dbb15bc15e0979",
            "17b47b6ee6be484285138c7cd0a21cff",
            "221586b4dce845eb86102300aacaa6d4",
            "a24115071b374598899e6719ca798b2b",
            "18d211c343ee4d919ee14baa958ab555",
            "e1b8b7799bf849f39b4a6be2c5d09305",
            "e652cb209d1e426ca2b9bc6e53298b34",
            "10bf616ae3de43cda467746544f6e48a",
            "0a2d58c9f5fe44d89ba3ffea45fb8a56",
            "d13e81bfd2764ceca2f3548fdf3308b8"
          ]
        },
        "id": "lAjQa7T7CFar",
        "outputId": "0d028edf-512d-40c3-991e-d6ca302829ec"
      },
      "execution_count": 87,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "INFO:pytorch_lightning.accelerators.cuda:LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Validation: |          | 0/? [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "c84c2227538e4f2686200d593cf20be4"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃\u001b[1m \u001b[0m\u001b[1m     Validate metric     \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m      DataLoader 0       \u001b[0m\u001b[1m \u001b[0m┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│\u001b[36m \u001b[0m\u001b[36m         val_acc         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.7818599939346313    \u001b[0m\u001b[35m \u001b[0m│\n",
              "│\u001b[36m \u001b[0m\u001b[36m        val_loss         \u001b[0m\u001b[36m \u001b[0m│\u001b[35m \u001b[0m\u001b[35m   0.5273974537849426    \u001b[0m\u001b[35m \u001b[0m│\n",
              "└───────────────────────────┴───────────────────────────┘\n"
            ],
            "text/html": [
              "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓\n",
              "┃<span style=\"font-weight: bold\">      Validate metric      </span>┃<span style=\"font-weight: bold\">       DataLoader 0        </span>┃\n",
              "┡━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">          val_acc          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.7818599939346313     </span>│\n",
              "│<span style=\"color: #008080; text-decoration-color: #008080\">         val_loss          </span>│<span style=\"color: #800080; text-decoration-color: #800080\">    0.5273974537849426     </span>│\n",
              "└───────────────────────────┴───────────────────────────┘\n",
              "</pre>\n"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[{'val_loss': 0.5273974537849426, 'val_acc': 0.7818599939346313}]"
            ]
          },
          "metadata": {},
          "execution_count": 87
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [],
      "metadata": {
        "id": "5wSjV8avdGbj"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}